/* Generated by Cython 0.24 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "C:\\Users\\Giorgos\\AppData\\Local\\Temp\\pip-build-env-hdpd1wc7\\Lib\\site-packages\\numpy\\core\\include\\numpy\\arrayobject.h",
            "C:\\Users\\Giorgos\\AppData\\Local\\Temp\\pip-build-env-hdpd1wc7\\Lib\\site-packages\\numpy\\core\\include\\numpy\\ufuncobject.h",
            "pylsewave\\include\\cypwfdm.h",
            "pylsewave\\include\\cypwfuns.h",
            "pylsewave\\include\\cypwmesh.h"
        ],
        "extra_compile_args": [
            "/Ot",
            "/openmp",
            "/EHsc",
            "/GA",
            "/favor:INTEL64"
        ],
        "include_dirs": [
            "pylsewave/include/",
            "C:\\Users\\Giorgos\\AppData\\Local\\Temp\\pip-build-env-hdpd1wc7\\Lib\\site-packages\\numpy\\core\\include"
        ],
        "language": "c++"
    }
}
END: Cython Metadata */

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

#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #define CYTHON_INLINE inline
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    operator T&() { return *ptr; }
  private:
    T *ptr;
};

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif


#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}

#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

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

#define __PYX_HAVE__pylsewave__cynum
#define __PYX_HAVE_API__pylsewave__cynum
#include "string.h"
#include "stdio.h"
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include <vector>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <string>
#include <utility>
#include <map>
#include "include/cypwfdm.h"
#include "include/cypwmesh.h"
#include "include/cypwfuns.h"
#include "math.h"
#include "pythread.h"
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(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
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(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 PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

/* None.proto */
#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[] = {
  "pylsewave\\cynum.pyx",
  "__init__.pxd",
  "stringsource",
  "type.pxd",
};
/* BufferFormatStructs.proto */
#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;

/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
  struct __pyx_memoryview_obj *memview;
  char *data;
  Py_ssize_t shape[8];
  Py_ssize_t strides[8];
  Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;

/* Atomics.proto */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __pyx_atomic_int_type int
#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
                    !defined(__i386__)
    #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
    #include <Windows.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type LONG
    #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
    #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
    #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
    #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using Intel atomics"
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
    #define __pyx_add_acquisition_count(memview)\
             __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
#else
    #define __pyx_add_acquisition_count(memview)\
            __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif


/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":725
 * # 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":726
 * 
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":727
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":728
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":732
 * #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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":733
 * 
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":734
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":735
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":739
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":740
 * 
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":749
 * # 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":750
 * # 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":751
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":753
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":754
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":755
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":757
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":758
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":760
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":761
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":762
 * 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;

/* "pylsewave/cynum.pyx":25
 * __author__ = "Georgios E. Ragkousis"
 * 
 * ctypedef np.float_t DTYPE_t             # <<<<<<<<<<<<<<
 * 
 * cdef int STATUS_OK = 0
 */
typedef __pyx_t_5numpy_float_t __pyx_t_9pylsewave_5cynum_DTYPE_t;
/* None.proto */
#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

/* None.proto */
#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_9pylsewave_5cynum_cyVessel;
struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled;
struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork;
struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc;
struct __pyx_obj_9pylsewave_5cynum_cPDEm;
struct __pyx_obj_9pylsewave_5cynum_cPDEsWat;
struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco;
struct __pyx_obj_9pylsewave_5cynum_PDEmCs;
struct __pyx_obj_9pylsewave_5cynum_cBCs;
struct __pyx_obj_9pylsewave_5cynum_cBCsWat;
struct __pyx_obj_9pylsewave_5cynum_BCsSc;
struct __pyx_obj_9pylsewave_5cynum_BCsD;
struct __pyx_obj_9pylsewave_5cynum_BCsADAN56;
struct __pyx_obj_9pylsewave_5cynum_cBCsHandModelNonReflBcs;
struct __pyx_obj_9pylsewave_5cynum_cFDMSolver;
struct __pyx_obj_9pylsewave_5cynum_cLaxWendroffSolver;
struct __pyx_obj_9pylsewave_5cynum_cMacCormackSolver;
struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver;
struct __pyx_array_obj;
struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":764
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":765
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":766
 * 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;

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":768
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;
struct __pyx_t_9pylsewave_5cynum_U;
struct __pyx_t_9pylsewave_5cynum_cvessel;
struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj;
struct __pyx_opt_args_9pylsewave_5cynum_10cFDMSolver_solve;
struct __pyx_opt_args_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_solve;
struct __pyx_opt_args_9pylsewave_5cynum_cLUdecomp;
struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_bif;
struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_conj;

/* "pylsewave/cynum.pyx":286
 * WRITE_STATUS = True
 * 
 * cdef enum CFL:             # <<<<<<<<<<<<<<
 *     CFL_STATUS_OK = 0
 *     CFL_STATUS_ERROR = -1
 */
enum __pyx_t_9pylsewave_5cynum_CFL {
  __pyx_e_9pylsewave_5cynum_CFL_STATUS_OK = 0,
  __pyx_e_9pylsewave_5cynum_CFL_STATUS_ERROR = -1L
};

/* "pylsewave/cynum.pyx":290
 *     CFL_STATUS_ERROR = -1
 * 
 * cdef enum SOLVER:             # <<<<<<<<<<<<<<
 *     SOLVER_STATUS_OK = 0
 *     SOLVER_STATUS_ERROR = -1
 */
enum __pyx_t_9pylsewave_5cynum_SOLVER {
  __pyx_e_9pylsewave_5cynum_SOLVER_STATUS_OK = 0,
  __pyx_e_9pylsewave_5cynum_SOLVER_STATUS_ERROR = -1L
};

/* "pylsewave/cynum.pyx":294
 *     SOLVER_STATUS_ERROR = -1
 * 
 * cdef struct U:             # <<<<<<<<<<<<<<
 *     double[:,::1] u
 *     double[:, ::1] u_n
 */
struct __pyx_t_9pylsewave_5cynum_U {
  __Pyx_memviewslice u;
  __Pyx_memviewslice u_n;
  __Pyx_memviewslice u_star;
  __Pyx_memviewslice u_store;
  __Pyx_memviewslice F_;
  __Pyx_memviewslice S_;
  __Pyx_memviewslice u_nh_mh;
  __Pyx_memviewslice u_nh_ph;
  __Pyx_memviewslice F_nh_mh;
  __Pyx_memviewslice S_nh_mh;
  __Pyx_memviewslice F_nh_ph;
  __Pyx_memviewslice F_star;
  __Pyx_memviewslice S_star;
  __Pyx_memviewslice S_nh_ph;
  double dx;
  Py_ssize_t x_size;
};

/* "pylsewave/cynum.pyx":306
 *     Py_ssize_t x_size
 * 
 * cdef struct cvessel:             # <<<<<<<<<<<<<<
 *     double[::1] r0, f_r0, interpolate_R0p, interpolate_R0m
 *     double[::1] f_r0_ph, f_r0_mh, df_dr0, df_dx
 */
struct __pyx_t_9pylsewave_5cynum_cvessel {
  __Pyx_memviewslice r0;
  __Pyx_memviewslice f_r0;
  __Pyx_memviewslice interpolate_R0p;
  __Pyx_memviewslice interpolate_R0m;
  __Pyx_memviewslice f_r0_ph;
  __Pyx_memviewslice f_r0_mh;
  __Pyx_memviewslice df_dr0;
  __Pyx_memviewslice df_dx;
  __Pyx_memviewslice df_dr0_ph;
  __Pyx_memviewslice df_dx_ph;
  __Pyx_memviewslice df_dr0_mh;
  __Pyx_memviewslice df_dx_mh;
  double L;
  double dx;
  double phi;
  __Pyx_memviewslice RLC;
};

/* "pylsewave/cynum.pyx":313
 *     double[::1] RLC
 * 
 * cdef struct cParabolicSolObj:             # <<<<<<<<<<<<<<
 *     double[:,::1] x_hyper
 *     double[::1] a
 */
struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj {
  __Pyx_memviewslice x_hyper;
  __Pyx_memviewslice a;
  __Pyx_memviewslice b;
  __Pyx_memviewslice c;
  __Pyx_memviewslice d;
  __Pyx_memviewslice a_ph;
  __Pyx_memviewslice a_mh;
};

/* "pylsewave/cynum.pyx":2173
 *     @cython.initializedcheck(False)
 *     @cython.cdivision(True)
 *     cpdef SOLVER solve(self, user_action=None,             # <<<<<<<<<<<<<<
 *               version="vectorised"):
 * 
 */
struct __pyx_opt_args_9pylsewave_5cynum_10cFDMSolver_solve {
  int __pyx_n;
  PyObject *user_action;
  PyObject *version;
};

/* "pylsewave/cynum.pyx":2632
 *     @cython.initializedcheck(False)
 *     @cython.cdivision(True)
 *     cpdef SOLVER solve(self, user_action=None,             # <<<<<<<<<<<<<<
 *               version="vectorised"):
 * 
 */
struct __pyx_opt_args_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_solve {
  int __pyx_n;
  PyObject *user_action;
  PyObject *version;
};

/* "pylsewave/cynum.pyx":2886
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cdef int cLUdecomp(double[:,::1] a, int[::1] seq, double tol=1.0e-09):             # <<<<<<<<<<<<<<
 *     """LU Doolittle's decomposition"""
 *     cdef int n, i, k, j, max_i, iterat
 */
struct __pyx_opt_args_9pylsewave_5cynum_cLUdecomp {
  int __pyx_n;
  double tol;
};

/* "pylsewave/cynum.pyx":2959
 * @cython.wraparound(False)
 * @cython.cdivision(True)
 * cdef int Newton_Raphson_Sys_bif(cBCs bcs, double[::1] x, double[::1] u, double dt, int[::1] vessel_indices,             # <<<<<<<<<<<<<<
 *                                 double eps, int N=100):
 *     cdef Py_ssize_t n, siz, i, j
 */
struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_bif {
  int __pyx_n;
  int N;
};

/* "pylsewave/cynum.pyx":3003
 * @cython.wraparound(False)
 * @cython.cdivision(True)
 * cdef int Newton_Raphson_Sys_conj(cBCs bcs, double[::1] x, double[::1] u, double dt, int[::1] vessel_indices,             # <<<<<<<<<<<<<<
 *                                  double eps, int N=100):
 *     cdef Py_ssize_t n, siz, i
 */
struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_conj {
  int __pyx_n;
  int N;
};

/* "pylsewave/cynum.pyx":31
 * 
 * 
 * cdef class cyVessel(object):             # <<<<<<<<<<<<<<
 *     cdef Vessel *thisptr
 * 
 */
struct __pyx_obj_9pylsewave_5cynum_cyVessel {
  PyObject_HEAD
  Vessel *thisptr;
};


/* "pylsewave/cynum.pyx":138
 * 
 * 
 * cdef class cyVesselScaled(cyVessel):             # <<<<<<<<<<<<<<
 *     cdef VesselScaled *thisptrDerived
 *     def __cinit__(self, string name, DTYPE_t L, DTYPE_t R_prox, DTYPE_t R_dist,
 */
struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled {
  struct __pyx_obj_9pylsewave_5cynum_cyVessel __pyx_base;
  VesselScaled *thisptrDerived;
};


/* "pylsewave/cynum.pyx":153
 *             del self.thisptrDerived
 * 
 * cdef class cyVesselNetwork(object):             # <<<<<<<<<<<<<<
 *     cdef VesselNetwork *thisptr
 *     # cdef cyVessel *a
 */
struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork {
  PyObject_HEAD
  VesselNetwork *thisptr;
  PyObject *_vessels;
};


/* "pylsewave/cynum.pyx":222
 *             del self.thisptr
 * 
 * cdef class cyVesselNetworkSc(cyVesselNetwork):             # <<<<<<<<<<<<<<
 *     cdef VesselNetworkSc *thisptrDerived
 *     def __cinit__(self, cyVessel vec = None, list vessels=None, DTYPE_t p0=-1, DTYPE_t rho=-1,
 */
struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc {
  struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork __pyx_base;
  VesselNetworkSc *thisptrDerived;
};


/* "pylsewave/cynum.pyx":322
 *     double[::1] a_mh
 * 
 * cdef class cPDEm:             # <<<<<<<<<<<<<<
 *     """
 *     .. math::
 */
struct __pyx_obj_9pylsewave_5cynum_cPDEm {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *__pyx_vtab;
  PyObject *mesh;
  double delta;
  double Re;
  double _rho;
  double _mu;
  std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  vessels;
};


/* "pylsewave/cynum.pyx":676
 * 
 * # ------------------- PDEs from Watanabe and modified by Ragkousis ----------------------- #
 * cdef class cPDEsWat(cPDEm):             # <<<<<<<<<<<<<<
 *     @cython.initializedcheck(False)
 *     @cython.cdivision(True)
 */
struct __pyx_obj_9pylsewave_5cynum_cPDEsWat {
  struct __pyx_obj_9pylsewave_5cynum_cPDEm __pyx_base;
};


/* "pylsewave/cynum.pyx":951
 * 
 * # ------------------- -------------------------------------------------- ----------------------- #
 * cdef class cPDEsWatVisco(cPDEsWat):             # <<<<<<<<<<<<<<
 *     """
 *     PDEs class to discretise a system with visco-elastic properties.
 */
struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco {
  struct __pyx_obj_9pylsewave_5cynum_cPDEsWat __pyx_base;
};


/* "pylsewave/cynum.pyx":1071
 * 
 * 
 * cdef class PDEmCs(cPDEm):             # <<<<<<<<<<<<<<
 *     @cython.initializedcheck(False)
 *     @cython.boundscheck(False)
 */
struct __pyx_obj_9pylsewave_5cynum_PDEmCs {
  struct __pyx_obj_9pylsewave_5cynum_cPDEm __pyx_base;
};


/* "pylsewave/cynum.pyx":1307
 * 
 * 
 * cdef class cBCs:             # <<<<<<<<<<<<<<
 *     """
 *     Class to set boundary conditions. Inlet, outlet, bifs and conjs.
 */
struct __pyx_obj_9pylsewave_5cynum_cBCs {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *__pyx_vtab;
  struct __pyx_obj_9pylsewave_5cynum_cPDEm *pdes;
  PyObject *mesh;
  PyObject *inlet_fun;
  std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  vessels;
  double _rho;
};


/* "pylsewave/cynum.pyx":1587
 * 
 * # ------------------- \begin{BCs from Watanabe and modified by Ragkousis} ----------------------- #
 * cdef class cBCsWat(cBCs):             # <<<<<<<<<<<<<<
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u
 */
struct __pyx_obj_9pylsewave_5cynum_cBCsWat {
  struct __pyx_obj_9pylsewave_5cynum_cBCs __pyx_base;
};


/* "pylsewave/cynum.pyx":1766
 * # ------------------- \end{BCs from Watanabe and modified by Ragkousis} ------------------------- #
 * 
 * cdef class BCsSc(cBCs):             # <<<<<<<<<<<<<<
 *     @cython.initializedcheck(False)
 *     @cython.boundscheck(False)
 */
struct __pyx_obj_9pylsewave_5cynum_BCsSc {
  struct __pyx_obj_9pylsewave_5cynum_cBCs __pyx_base;
};


/* "pylsewave/cynum.pyx":1924
 * 
 * 
 * cdef class BCsD(cBCs):             # <<<<<<<<<<<<<<
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u
 */
struct __pyx_obj_9pylsewave_5cynum_BCsD {
  struct __pyx_obj_9pylsewave_5cynum_cBCs __pyx_base;
};


/* "pylsewave/cynum.pyx":1951
 * 
 * 
 * cdef class BCsADAN56(cBCsWat):             # <<<<<<<<<<<<<<
 * 
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 */
struct __pyx_obj_9pylsewave_5cynum_BCsADAN56 {
  struct __pyx_obj_9pylsewave_5cynum_cBCsWat __pyx_base;
};


/* "pylsewave/cynum.pyx":2011
 *         return STATUS_OK
 * 
 * cdef class cBCsHandModelNonReflBcs(cBCsWat):             # <<<<<<<<<<<<<<
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u
 */
struct __pyx_obj_9pylsewave_5cynum_cBCsHandModelNonReflBcs {
  struct __pyx_obj_9pylsewave_5cynum_cBCsWat __pyx_base;
};


/* "pylsewave/cynum.pyx":2039
 * 
 * 
 * cdef class cFDMSolver:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for finite-difference computing schemes.
 */
struct __pyx_obj_9pylsewave_5cynum_cFDMSolver {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver *__pyx_vtab;
  PyObject *mesh;
  struct __pyx_obj_9pylsewave_5cynum_cPDEm *_pdes;
  struct __pyx_obj_9pylsewave_5cynum_cBCs *_bcs;
  int _no_cycles;
  double _dt;
  int _Nx;
  int _Nt;
  __Pyx_memviewslice _t;
  double _T;
  __Pyx_memviewslice U0_arr;
  __Pyx_memviewslice UL_arr;
  __Pyx_memviewslice _It;
  __Pyx_memviewslice UBif_arr;
  __Pyx_memviewslice UConj_arr;
  double _C;
};


/* "pylsewave/cynum.pyx":2426
 * 
 * 
 * cdef class cLaxWendroffSolver(cFDMSolver):             # <<<<<<<<<<<<<<
 *     """
 * 
 */
struct __pyx_obj_9pylsewave_5cynum_cLaxWendroffSolver {
  struct __pyx_obj_9pylsewave_5cynum_cFDMSolver __pyx_base;
};


/* "pylsewave/cynum.pyx":2509
 *                            dt2*(vec.S_nh_ph[1, i] + vec.S_nh_mh[1, i]))
 * 
 * cdef class cMacCormackSolver(cFDMSolver):             # <<<<<<<<<<<<<<
 *     """
 *     Class with the MacCormack scheme implementation.
 */
struct __pyx_obj_9pylsewave_5cynum_cMacCormackSolver {
  struct __pyx_obj_9pylsewave_5cynum_cFDMSolver __pyx_base;
};


/* "pylsewave/cynum.pyx":2577
 * 
 * 
 * cdef class cMacCormackGodunovSplitSolver(cMacCormackSolver):             # <<<<<<<<<<<<<<
 *     """
 *     Solve U_t + F_x = S
 */
struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver {
  struct __pyx_obj_9pylsewave_5cynum_cMacCormackSolver __pyx_base;
};


/* "View.MemoryView":103
 * 
 * @cname("__pyx_array")
 * cdef class array:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_array_obj {
  PyObject_HEAD
  struct __pyx_vtabstruct_array *__pyx_vtab;
  char *data;
  Py_ssize_t len;
  char *format;
  int ndim;
  Py_ssize_t *_shape;
  Py_ssize_t *_strides;
  Py_ssize_t itemsize;
  PyObject *mode;
  PyObject *_format;
  void (*callback_free_data)(void *);
  int free_data;
  int dtype_is_object;
};


/* "View.MemoryView":275
 * 
 * @cname('__pyx_MemviewEnum')
 * cdef class Enum(object):             # <<<<<<<<<<<<<<
 *     cdef object name
 *     def __init__(self, name):
 */
struct __pyx_MemviewEnum_obj {
  PyObject_HEAD
  PyObject *name;
};


/* "View.MemoryView":326
 * 
 * @cname('__pyx_memoryview')
 * cdef class memoryview(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef object obj
 */
struct __pyx_memoryview_obj {
  PyObject_HEAD
  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
  PyObject *obj;
  PyObject *_size;
  PyObject *_array_interface;
  PyThread_type_lock lock;
  __pyx_atomic_int acquisition_count[2];
  __pyx_atomic_int *acquisition_count_aligned_p;
  Py_buffer view;
  int flags;
  int dtype_is_object;
  __Pyx_TypeInfo *typeinfo;
};


/* "View.MemoryView":951
 * 
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
 *     "Internal class for passing memoryview slices to Python"
 * 
 */
struct __pyx_memoryviewslice_obj {
  struct __pyx_memoryview_obj __pyx_base;
  __Pyx_memviewslice from_slice;
  PyObject *from_object;
  PyObject *(*to_object_func)(char *);
  int (*to_dtype_func)(char *, PyObject *);
};



/* "pylsewave/cynum.pyx":322
 *     double[::1] a_mh
 * 
 * cdef class cPDEm:             # <<<<<<<<<<<<<<
 *     """
 *     .. math::
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm {
  void (*set_boundary_layer_th)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, double, int, int __pyx_skip_dispatch);
  void (*set_vessels)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &, int, int __pyx_skip_dispatch);
  int (*flux)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, __Pyx_memviewslice);
  void (*flux_i)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, int, __Pyx_memviewslice, int __pyx_skip_dispatch);
  std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  (*get_vessels)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *);
  int (*source)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, __Pyx_memviewslice);
  void (*source_i)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, int, __Pyx_memviewslice, int __pyx_skip_dispatch);
  double (*pressure_i)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, double, int, int);
  void (*pressure)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, __Pyx_memviewslice);
  double (*compute_c_i)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, double, int, int, int __pyx_skip_dispatch);
  void (*compute_c)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, __Pyx_memviewslice, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *__pyx_vtabptr_9pylsewave_5cynum_cPDEm;


/* "pylsewave/cynum.pyx":676
 * 
 * # ------------------- PDEs from Watanabe and modified by Ragkousis ----------------------- #
 * cdef class cPDEsWat(cPDEm):             # <<<<<<<<<<<<<<
 *     @cython.initializedcheck(False)
 *     @cython.cdivision(True)
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEsWat {
  struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm __pyx_base;
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEsWat *__pyx_vtabptr_9pylsewave_5cynum_cPDEsWat;


/* "pylsewave/cynum.pyx":951
 * 
 * # ------------------- -------------------------------------------------- ----------------------- #
 * cdef class cPDEsWatVisco(cPDEsWat):             # <<<<<<<<<<<<<<
 *     """
 *     PDEs class to discretise a system with visco-elastic properties.
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEsWatVisco {
  struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEsWat __pyx_base;
  void (*set_vessels)(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &, int, int __pyx_skip_dispatch);
  void (*pressure_visco)(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *, __Pyx_memviewslice, int, __Pyx_memviewslice, int __pyx_skip_dispatch);
  int (*CV_f)(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *, __Pyx_memviewslice, Py_ssize_t, __Pyx_memviewslice, int __pyx_skip_dispatch);
  int (*wall_th_x)(__Pyx_memviewslice, __Pyx_memviewslice);
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEsWatVisco *__pyx_vtabptr_9pylsewave_5cynum_cPDEsWatVisco;


/* "pylsewave/cynum.pyx":1071
 * 
 * 
 * cdef class PDEmCs(cPDEm):             # <<<<<<<<<<<<<<
 *     @cython.initializedcheck(False)
 *     @cython.boundscheck(False)
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_PDEmCs {
  struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm __pyx_base;
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_PDEmCs *__pyx_vtabptr_9pylsewave_5cynum_PDEmCs;


/* "pylsewave/cynum.pyx":1307
 * 
 * 
 * cdef class cBCs:             # <<<<<<<<<<<<<<
 *     """
 *     Class to set boundary conditions. Inlet, outlet, bifs and conjs.
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs {
  void (*set_vessels)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel> );
  struct __pyx_obj_9pylsewave_5cynum_cPDEm *(*get_pdes)(struct __pyx_obj_9pylsewave_5cynum_cBCs *);
  void (*set_pdes)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, struct __pyx_obj_9pylsewave_5cynum_cPDEm *);
  void (*U_0)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, double, double, double, int, __Pyx_memviewslice, int __pyx_skip_dispatch);
  int (*U_L)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, double, double, double, int, __Pyx_memviewslice);
  void (*I)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, double, int, int, __Pyx_memviewslice, int __pyx_skip_dispatch);
  int (*bifurcation_R)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, double, __Pyx_memviewslice, __Pyx_memviewslice);
  int (*bifurcation_Jr)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice);
  int (*conjuction_R)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, double, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
  int (*conjuction_Jr)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *__pyx_vtabptr_9pylsewave_5cynum_cBCs;


/* "pylsewave/cynum.pyx":1587
 * 
 * # ------------------- \begin{BCs from Watanabe and modified by Ragkousis} ----------------------- #
 * cdef class cBCsWat(cBCs):             # <<<<<<<<<<<<<<
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_cBCsWat {
  struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs __pyx_base;
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_cBCsWat *__pyx_vtabptr_9pylsewave_5cynum_cBCsWat;


/* "pylsewave/cynum.pyx":1766
 * # ------------------- \end{BCs from Watanabe and modified by Ragkousis} ------------------------- #
 * 
 * cdef class BCsSc(cBCs):             # <<<<<<<<<<<<<<
 *     @cython.initializedcheck(False)
 *     @cython.boundscheck(False)
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_BCsSc {
  struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs __pyx_base;
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_BCsSc *__pyx_vtabptr_9pylsewave_5cynum_BCsSc;


/* "pylsewave/cynum.pyx":1924
 * 
 * 
 * cdef class BCsD(cBCs):             # <<<<<<<<<<<<<<
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_BCsD {
  struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs __pyx_base;
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_BCsD *__pyx_vtabptr_9pylsewave_5cynum_BCsD;


/* "pylsewave/cynum.pyx":1951
 * 
 * 
 * cdef class BCsADAN56(cBCsWat):             # <<<<<<<<<<<<<<
 * 
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_BCsADAN56 {
  struct __pyx_vtabstruct_9pylsewave_5cynum_cBCsWat __pyx_base;
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_BCsADAN56 *__pyx_vtabptr_9pylsewave_5cynum_BCsADAN56;


/* "pylsewave/cynum.pyx":2011
 *         return STATUS_OK
 * 
 * cdef class cBCsHandModelNonReflBcs(cBCsWat):             # <<<<<<<<<<<<<<
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_cBCsHandModelNonReflBcs {
  struct __pyx_vtabstruct_9pylsewave_5cynum_cBCsWat __pyx_base;
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_cBCsHandModelNonReflBcs *__pyx_vtabptr_9pylsewave_5cynum_cBCsHandModelNonReflBcs;


/* "pylsewave/cynum.pyx":2039
 * 
 * 
 * cdef class cFDMSolver:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for finite-difference computing schemes.
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver {
  void (*set_T)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, double, double, int, int __pyx_skip_dispatch);
  void (*set_BC)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch);
  enum __pyx_t_9pylsewave_5cynum_CFL (*cfl_i)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, __Pyx_memviewslice, double, double, int, int);
  enum __pyx_t_9pylsewave_5cynum_CFL (*cfl_condition)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, __Pyx_memviewslice, double, double, int);
  void (*initialise_solution_vector)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, std::vector<struct __pyx_t_9pylsewave_5cynum_U>  &, int);
  enum __pyx_t_9pylsewave_5cynum_SOLVER (*solve)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pylsewave_5cynum_10cFDMSolver_solve *__pyx_optional_args);
  void (*advance)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, struct __pyx_t_9pylsewave_5cynum_U, double, double, int);
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver *__pyx_vtabptr_9pylsewave_5cynum_cFDMSolver;


/* "pylsewave/cynum.pyx":2426
 * 
 * 
 * cdef class cLaxWendroffSolver(cFDMSolver):             # <<<<<<<<<<<<<<
 *     """
 * 
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_cLaxWendroffSolver {
  struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver __pyx_base;
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_cLaxWendroffSolver *__pyx_vtabptr_9pylsewave_5cynum_cLaxWendroffSolver;


/* "pylsewave/cynum.pyx":2509
 *                            dt2*(vec.S_nh_ph[1, i] + vec.S_nh_mh[1, i]))
 * 
 * cdef class cMacCormackSolver(cFDMSolver):             # <<<<<<<<<<<<<<
 *     """
 *     Class with the MacCormack scheme implementation.
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_cMacCormackSolver {
  struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver __pyx_base;
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_cMacCormackSolver *__pyx_vtabptr_9pylsewave_5cynum_cMacCormackSolver;


/* "pylsewave/cynum.pyx":2577
 * 
 * 
 * cdef class cMacCormackGodunovSplitSolver(cMacCormackSolver):             # <<<<<<<<<<<<<<
 *     """
 *     Solve U_t + F_x = S
 */

struct __pyx_vtabstruct_9pylsewave_5cynum_cMacCormackGodunovSplitSolver {
  struct __pyx_vtabstruct_9pylsewave_5cynum_cMacCormackSolver __pyx_base;
  int (*_advance_Godunov_splitting)(struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *, struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj, __Pyx_memviewslice, int, double, double, int, double, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *__pyx_vtabptr_9pylsewave_5cynum_cMacCormackGodunovSplitSolver;


/* "View.MemoryView":103
 * 
 * @cname("__pyx_array")
 * cdef class array:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

struct __pyx_vtabstruct_array {
  PyObject *(*get_memview)(struct __pyx_array_obj *);
};
static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;


/* "View.MemoryView":326
 * 
 * @cname('__pyx_memoryview')
 * cdef class memoryview(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef object obj
 */

struct __pyx_vtabstruct_memoryview {
  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
};
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;


/* "View.MemoryView":951
 * 
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
 *     "Internal class for passing memoryview slices to Python"
 * 
 */

struct __pyx_vtabstruct__memoryviewslice {
  struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#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)

/* PyObjectGetAttrStr.proto */
#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

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

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

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

/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* BufferFormatCheck.proto */
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 const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type); // PROTO

/* PyThreadStateGet.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

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

/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT   1
#define __Pyx_MEMVIEW_PTR      2
#define __Pyx_MEMVIEW_FULL     4
#define __Pyx_MEMVIEW_CONTIG   8
#define __Pyx_MEMVIEW_STRIDED  16
#define __Pyx_MEMVIEW_FOLLOW   32
#define __Pyx_IS_C_CONTIG 1
#define __Pyx_IS_F_CONTIG 2
static int __Pyx_init_memviewslice(
                struct __pyx_memoryview_obj *memview,
                int ndim,
                __Pyx_memviewslice *memviewslice,
                int memview_is_new_reference);
static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
    __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
    __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* PyObjectCallNoArg.proto */
#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

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* PyIntBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyIntBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* PyFloatBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace);
#else
#define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace)\
    ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)))
    #endif

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* PyIntBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
    PyObject_RichCompare(op1, op2, Py_EQ)
    #endif

/* PyIntBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

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

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

/* SaveResetException.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* PyErrExceptionMatches.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* GetException.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

/* UnpackTuple2.proto */
static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
                                             int is_tuple, int has_known_size, int decref_tuple);

/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);

/* ListCompAppend.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

/* None.proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);

/* UnaryNegOverflows.proto */
#define UNARY_NEG_WOULD_OVERFLOW(x)\
        (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* SwapException.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject* none = _PyList_Extend((PyListObject*)L, v);
    if (unlikely(!none))
        return -1;
    Py_DECREF(none);
    return 0;
#else
    return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
#endif
}

/* ListAppend.proto */
#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

/* None.proto */
static CYTHON_INLINE long __Pyx_div_long(long, long);

/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __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);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

#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


/* BufferStructDeclare.proto */
typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

/* None.proto */
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};

/* MemviewSliceIsContig.proto */
static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
                                        char order, int ndim);

/* OverlappingSlices.proto */
static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
                                __Pyx_memviewslice *slice2,
                                int ndim, size_t itemsize);

/* Capsule.proto */
static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);

/* None.proto */
#include <new>

/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);

/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                __Pyx_TypeInfo *dtype,
                __Pyx_BufFmt_StackElem stack[],
                __Pyx_memviewslice *memviewslice,
                PyObject *original_obj);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject *);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_int(PyObject *);

/* CppExceptionConversion.proto */
#ifndef __Pyx_CppExn2PyErr
#include <new>
#include <typeinfo>
#include <stdexcept>
#include <ios>
static void __Pyx_CppExn2PyErr() {
  try {
    if (PyErr_Occurred())
      ; // let the latest Python exn pass through and ignore the current one
    else
      throw;
  } catch (const std::bad_alloc& exn) {
    PyErr_SetString(PyExc_MemoryError, exn.what());
  } catch (const std::bad_cast& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::domain_error& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::invalid_argument& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::ios_base::failure& exn) {
    PyErr_SetString(PyExc_IOError, exn.what());
  } catch (const std::out_of_range& exn) {
    PyErr_SetString(PyExc_IndexError, exn.what());
  } catch (const std::overflow_error& exn) {
    PyErr_SetString(PyExc_OverflowError, exn.what());
  } catch (const std::range_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::underflow_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::exception& exn) {
    PyErr_SetString(PyExc_RuntimeError, exn.what());
  }
  catch (...)
  {
    PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  }
}
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* MemviewDtypeToObject.proto */
static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);

struct __pyx_t_9pylsewave_5cynum_cvessel;
static PyObject* __pyx_convert__to_py_struct____pyx_t_9pylsewave_5cynum_cvessel(struct __pyx_t_9pylsewave_5cynum_cvessel s);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);

/* MemviewDtypeToObject.proto */
static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* Print.proto */
static int __Pyx_Print(PyObject*, PyObject *, int);
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

/* None.proto */
static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void); /* proto */

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_9pylsewave_5cynum_SOLVER(enum __pyx_t_9pylsewave_5cynum_SOLVER value);

struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj;
static PyObject* __pyx_convert__to_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj(struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj s);
/* None.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* None.proto */
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* None.proto */
#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

/* None.proto */
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

/* None.proto */
#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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);

/* MemviewSliceCopyTemplate.proto */
static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                 const char *mode, int ndim,
                                 size_t sizeof_dtype, int contig_flag,
                                 int dtype_is_object);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_9pylsewave_5cynum_SOLVER __Pyx_PyInt_As_enum____pyx_t_9pylsewave_5cynum_SOLVER(PyObject *);

/* PrintOne.proto */
static int __Pyx_PrintOne(PyObject* stream, PyObject *o);

/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* PyIdentifierFromString.proto */
#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

/* ModuleImport.proto */
static PyObject *__Pyx_ImportModule(const char *name);

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

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static void __pyx_f_9pylsewave_5cynum_5cPDEm_set_boundary_layer_th(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, double __pyx_v_T, int __pyx_v_no_cycles, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pylsewave_5cynum_5cPDEm_set_vessels(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, CYTHON_UNUSED std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &__pyx_v_vectorV, int __pyx_v_siz, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_5cPDEm_flux(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_F); /* proto*/
static void __pyx_f_9pylsewave_5cynum_5cPDEm_flux_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f, int __pyx_skip_dispatch); /* proto*/
static std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_f_9pylsewave_5cynum_5cPDEm_get_vessels(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self); /* proto*/
static int __pyx_f_9pylsewave_5cynum_5cPDEm_source(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_S); /* proto*/
static void __pyx_f_9pylsewave_5cynum_5cPDEm_source_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_9pylsewave_5cynum_5cPDEm_pressure_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index); /* proto*/
static void __pyx_f_9pylsewave_5cynum_5cPDEm_pressure(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_p); /* proto*/
static double __pyx_f_9pylsewave_5cynum_5cPDEm_compute_c_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pylsewave_5cynum_5cPDEm_compute_c(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_9pylsewave_5cynum_8cPDEsWat_compute_c_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pylsewave_5cynum_8cPDEsWat_compute_c(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_9pylsewave_5cynum_8cPDEsWat_pressure_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index); /* proto*/
static void __pyx_f_9pylsewave_5cynum_8cPDEsWat_pressure(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_p); /* proto*/
static int __pyx_f_9pylsewave_5cynum_8cPDEsWat_flux(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_F); /* proto*/
static void __pyx_f_9pylsewave_5cynum_8cPDEsWat_flux_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_8cPDEsWat_source(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_S); /* proto*/
static void __pyx_f_9pylsewave_5cynum_8cPDEsWat_source_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s, int __pyx_skip_dispatch); /* proto*/
void __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_set_vessels(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, CYTHON_UNUSED std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &__pyx_v_vectorV, int __pyx_v_siz, int __pyx_skip_dispatch); /* proto*/
void __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_set_vessels__pyx_wrap_1(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, CYTHON_UNUSED std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &__pyx_v_vectorV, int __pyx_v_siz, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_pressure_visco(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_p, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_CV_f(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_wall_th_x(__Pyx_memviewslice __pyx_v_r0, __Pyx_memviewslice __pyx_v_out); /* proto*/
static int __pyx_f_9pylsewave_5cynum_6PDEmCs_flux(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_F); /* proto*/
static void __pyx_f_9pylsewave_5cynum_6PDEmCs_flux_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f, int __pyx_skip_dispatch); /* proto*/
static std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_f_9pylsewave_5cynum_6PDEmCs_get_vessels(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self); /* proto*/
static int __pyx_f_9pylsewave_5cynum_6PDEmCs_source(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_S); /* proto*/
static void __pyx_f_9pylsewave_5cynum_6PDEmCs_source_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_9pylsewave_5cynum_6PDEmCs_compute_c_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pylsewave_5cynum_6PDEmCs_compute_c(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pylsewave_5cynum_4cBCs_set_vessels(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_v_invessels); /* proto*/
static struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_f_9pylsewave_5cynum_4cBCs_get_pdes(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self); /* proto*/
static void __pyx_f_9pylsewave_5cynum_4cBCs_set_pdes(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_pdes); /* proto*/
static void __pyx_f_9pylsewave_5cynum_4cBCs_U_0(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_4cBCs_U_L(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out); /* proto*/
static void __pyx_f_9pylsewave_5cynum_4cBCs_I(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, CYTHON_UNUSED double __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_4cBCs_bifurcation_R(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto*/
static int __pyx_f_9pylsewave_5cynum_4cBCs_bifurcation_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto*/
static int __pyx_f_9pylsewave_5cynum_4cBCs_conjuction_R(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_4cBCs_conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pylsewave_5cynum_7cBCsWat_U_0(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_7cBCsWat_bifurcation_R(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto*/
static int __pyx_f_9pylsewave_5cynum_7cBCsWat_bifurcation_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto*/
static int __pyx_f_9pylsewave_5cynum_7cBCsWat_conjuction_R(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_7cBCsWat_conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_5BCsSc_bifurcation_R(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto*/
static int __pyx_f_9pylsewave_5cynum_5BCsSc_bifurcation_Jr(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto*/
static int __pyx_f_9pylsewave_5cynum_5BCsSc_conjuction_R(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_5BCsSc_conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pylsewave_5cynum_4BCsD_U_0(struct __pyx_obj_9pylsewave_5cynum_BCsD *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pylsewave_5cynum_9BCsADAN56_U_0(struct __pyx_obj_9pylsewave_5cynum_BCsADAN56 *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, CYTHON_UNUSED int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_9pylsewave_5cynum_9BCsADAN56_U_L(struct __pyx_obj_9pylsewave_5cynum_BCsADAN56 *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out); /* proto*/
static void __pyx_f_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_U_0(struct __pyx_obj_9pylsewave_5cynum_cBCsHandModelNonReflBcs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pylsewave_5cynum_10cFDMSolver_set_T(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, double __pyx_v_dt, double __pyx_v_T, int __pyx_v_no_cycles, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pylsewave_5cynum_10cFDMSolver_set_BC(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, __Pyx_memviewslice __pyx_v_U0_array, __Pyx_memviewslice __pyx_v_UL_array, __Pyx_memviewslice __pyx_v_UBif_array, __Pyx_memviewslice __pyx_v_UConj_array, int __pyx_skip_dispatch); /* proto*/
static enum __pyx_t_9pylsewave_5cynum_CFL __pyx_f_9pylsewave_5cynum_10cFDMSolver_cfl_i(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, __Pyx_memviewslice __pyx_v_uin, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_index, int __pyx_v_vessel_index); /* proto*/
static enum __pyx_t_9pylsewave_5cynum_CFL __pyx_f_9pylsewave_5cynum_10cFDMSolver_cfl_condition(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, __Pyx_memviewslice __pyx_v_uin, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index); /* proto*/
static void __pyx_f_9pylsewave_5cynum_10cFDMSolver_initialise_solution_vector(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, std::vector<struct __pyx_t_9pylsewave_5cynum_U>  &__pyx_v_vectorU, int __pyx_v_length); /* proto*/
static enum __pyx_t_9pylsewave_5cynum_SOLVER __pyx_f_9pylsewave_5cynum_10cFDMSolver_solve(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pylsewave_5cynum_10cFDMSolver_solve *__pyx_optional_args); /* proto*/
static void __pyx_f_9pylsewave_5cynum_10cFDMSolver_advance(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, struct __pyx_t_9pylsewave_5cynum_U __pyx_v_vec, double __pyx_v_dt, double __pyx_v_dx, int __pyx_v_vessel_index); /* proto*/
static void __pyx_f_9pylsewave_5cynum_18cLaxWendroffSolver_advance(struct __pyx_obj_9pylsewave_5cynum_cLaxWendroffSolver *__pyx_v_self, struct __pyx_t_9pylsewave_5cynum_U __pyx_v_vec, double __pyx_v_dt, double __pyx_v_dx, int __pyx_v_vessel_index); /* proto*/
static void __pyx_f_9pylsewave_5cynum_17cMacCormackSolver_advance(struct __pyx_obj_9pylsewave_5cynum_cMacCormackSolver *__pyx_v_self, struct __pyx_t_9pylsewave_5cynum_U __pyx_v_vec, double __pyx_v_dt, double __pyx_v_dx, int __pyx_v_vessel_index); /* proto*/
static int __pyx_f_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver__advance_Godunov_splitting(struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *__pyx_v_self, struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj __pyx_v_parStruct, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED int __pyx_v_n, CYTHON_UNUSED double __pyx_v_dt, CYTHON_UNUSED double __pyx_v_dx, int __pyx_v_vessel_index, double __pyx_v_theta, int __pyx_skip_dispatch); /* proto*/
static enum __pyx_t_9pylsewave_5cynum_SOLVER __pyx_f_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_solve(struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_solve *__pyx_optional_args); /* proto*/
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/

/* Module declarations from 'cython.view' */

/* Module declarations from 'cython' */

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

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

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

/* Module declarations from '__builtin__' */

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

/* Module declarations from 'cpython' */

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

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

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

/* Module declarations from 'numpy' */

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

/* Module declarations from 'libcpp.vector' */

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

/* Module declarations from 'libcpp.utility' */

/* Module declarations from 'libcpp.map' */

/* Module declarations from 'pylsewave.c_cynum' */

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

/* Module declarations from 'pylsewave.cynum' */
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cyVessel = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cyVesselScaled = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cyVesselNetwork = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cyVesselNetworkSc = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cPDEm = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cPDEsWat = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cPDEsWatVisco = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_PDEmCs = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cBCs = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cBCsWat = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_BCsSc = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_BCsD = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_BCsADAN56 = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cBCsHandModelNonReflBcs = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cFDMSolver = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cLaxWendroffSolver = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cMacCormackSolver = 0;
static PyTypeObject *__pyx_ptype_9pylsewave_5cynum_cMacCormackGodunovSplitSolver = 0;
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
static PyTypeObject *__pyx_memoryviewslice_type = 0;
static int __pyx_v_9pylsewave_5cynum_STATUS_OK;
static int __pyx_v_9pylsewave_5cynum_STATUS_ERROR;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
static int __pyx_memoryview_thread_locks_used;
static PyThread_type_lock __pyx_memoryview_thread_locks[8];
static double __pyx_f_9pylsewave_5cynum_pystd_dev(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_9pylsewave_5cynum_pytdma(PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_9pylsewave_5cynum_cpwgrad(PyArrayObject *, PyArrayObject *, double, int __pyx_skip_dispatch); /*proto*/
static double __pyx_f_9pylsewave_5cynum_norm2(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static double __pyx_f_9pylsewave_5cynum_dotVec(__Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_9pylsewave_5cynum_swaprows(__Pyx_memviewslice, int, int); /*proto*/
static void __pyx_f_9pylsewave_5cynum_swaprowsVd(__Pyx_memviewslice, int, int); /*proto*/
static void __pyx_f_9pylsewave_5cynum_swaprowsVi(__Pyx_memviewslice, int, int); /*proto*/
static int __pyx_f_9pylsewave_5cynum_cLUdecomp(__Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_opt_args_9pylsewave_5cynum_cLUdecomp *__pyx_optional_args); /*proto*/
static int __pyx_f_9pylsewave_5cynum_cLUsolve(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
static int __pyx_f_9pylsewave_5cynum_Newton_Raphson_Sys_bif(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, double, __Pyx_memviewslice, double, struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_bif *__pyx_optional_args); /*proto*/
static int __pyx_f_9pylsewave_5cynum_Newton_Raphson_Sys_conj(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, double, __Pyx_memviewslice, double, struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_conj *__pyx_optional_args); /*proto*/
static double __pyx_f_9pylsewave_5cynum_linear_extrapolation(double, double, double, double, double, int __pyx_skip_dispatch); /*proto*/
static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
static struct __pyx_t_9pylsewave_5cynum_cvessel __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(PyObject *); /*proto*/
static std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(PyObject *); /*proto*/
static struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj(PyObject *); /*proto*/
static std::map<std::string,double>  __pyx_convert_map_from_py_std_3a__3a_string__and_double(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
static PyObject *__pyx_convert_map_to_py_std_3a__3a_string____double(std::map<std::string,double>  const &); /*proto*/
static PyObject *__pyx_convert_vector_to_py_double(const std::vector<double>  &); /*proto*/
static std::vector<double>  __pyx_convert_vector_from_py_double(PyObject *); /*proto*/
static PyObject *__pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel(const std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &); /*proto*/
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
static void *__pyx_align_pointer(void *, size_t); /*proto*/
static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
static PyObject *_unellipsify(PyObject *, int); /*proto*/
static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static __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_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
#define __Pyx_MODULE_NAME "pylsewave.cynum"
int __pyx_module_is_main_pylsewave__cynum = 0;

/* Implementation of 'pylsewave.cynum' */
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_round;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_IndexError;
static const char __pyx_k_I[] = "I";
static const char __pyx_k_L[] = "L";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_T[] = "T";
static const char __pyx_k_a[] = "a";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_u[] = "u";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_Id[] = "Id";
static const char __pyx_k_Nx[] = "Nx";
static const char __pyx_k_Re[] = "Re";
static const char __pyx_k_dt[] = "dt";
static const char __pyx_k_dx[] = "dx";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_mu[] = "mu";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_p0[] = "p0";
static const char __pyx_k_pi[] = "pi";
static const char __pyx_k_qc[] = "qc";
static const char __pyx_k_r0[] = "r0";
static const char __pyx_k_rc[] = "rc";
static const char __pyx_k_x1[] = "x1";
static const char __pyx_k_x2[] = "x2";
static const char __pyx_k_y1[] = "y1";
static const char __pyx_k_y2[] = "y2";
static const char __pyx_k_RLC[] = "RLC";
static const char __pyx_k_U_0[] = "U_0";
static const char __pyx_k_bcs[] = "bcs";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_int[] = "int";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_out[] = "out";
static const char __pyx_k_phi[] = "phi";
static const char __pyx_k_rho[] = "rho";
static const char __pyx_k_rws[] = "rws";
static const char __pyx_k_siz[] = "siz";
static const char __pyx_k_vec[] = "vec";
static const char __pyx_k_CV_f[] = "CV_f";
static const char __pyx_k_a_mh[] = "a_mh";
static const char __pyx_k_a_ph[] = "a_ph";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_clms[] = "clms";
static const char __pyx_k_f_r0[] = "f_r0";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mesh[] = "mesh";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_ndim[] = "ndim";
static const char __pyx_k_pack[] = "pack";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_sqrt[] = "sqrt";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_ASCII[] = "ASCII";
static const char __pyx_k_Windk[] = "Windk";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_clock[] = "clock";
static const char __pyx_k_df_dx[] = "df_dx";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_float[] = "float";
static const char __pyx_k_inarr[] = "inarr";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_out_c[] = "out_c";
static const char __pyx_k_out_f[] = "out_f";
static const char __pyx_k_out_p[] = "out_p";
static const char __pyx_k_out_s[] = "out_s";
static const char __pyx_k_power[] = "power";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_round[] = "round";
static const char __pyx_k_set_T[] = "set_T";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_solve[] = "solve";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_theta[] = "theta";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_R_dist[] = "R_dist";
static const char __pyx_k_R_prox[] = "R_prox";
static const char __pyx_k_arange[] = "arange";
static const char __pyx_k_author[] = "__author__";
static const char __pyx_k_df_dr0[] = "df_dr0";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_flux_i[] = "flux_i";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_inpdes[] = "inpdes";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_set_BC[] = "set_BC";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_unpack[] = "unpack";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_Wall_th[] = "Wall_th";
static const char __pyx_k_asarray[] = "asarray";
static const char __pyx_k_f_r0_mh[] = "f_r0_mh";
static const char __pyx_k_f_r0_ph[] = "f_r0_ph";
static const char __pyx_k_fortran[] = "fortran";
static const char __pyx_k_input_v[] = "input_v";
static const char __pyx_k_memview[] = "memview";
static const char __pyx_k_vectorV[] = "vectorV";
static const char __pyx_k_version[] = "version";
static const char __pyx_k_vessels[] = "vessels";
static const char __pyx_k_x_hyper[] = "x_hyper";
static const char __pyx_k_Ellipsis[] = "Ellipsis";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_U0_array[] = "U0_array";
static const char __pyx_k_UL_array[] = "UL_array";
static const char __pyx_k_df_dx_mh[] = "df_dx_mh";
static const char __pyx_k_df_dx_ph[] = "df_dx_ph";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_itemsize[] = "itemsize";
static const char __pyx_k_linspace[] = "linspace";
static const char __pyx_k_source_i[] = "source_i";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_compute_c[] = "compute_c";
static const char __pyx_k_df_dr0_mh[] = "df_dr0_mh";
static const char __pyx_k_df_dr0_ph[] = "df_dr0_ph";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_inletfunc[] = "inletfunc";
static const char __pyx_k_iteritems[] = "iteritems";
static const char __pyx_k_no_cycles[] = "no_cycles";
static const char __pyx_k_parStruct[] = "parStruct";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_UBif_array[] = "UBif_array";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_skip_frame[] = "skip_frame";
static const char __pyx_k_vectorised[] = "vectorised";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_UConj_array[] = "UConj_array";
static const char __pyx_k_compute_c_i[] = "compute_c_i";
static const char __pyx_k_cwrite2file[] = "cwrite2file";
static const char __pyx_k_set_vessels[] = "set_vessels";
static const char __pyx_k_user_action[] = "user_action";
static const char __pyx_k_PRINT_STATUS[] = "PRINT_STATUS";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_WRITE_STATUS[] = "WRITE_STATUS";
static const char __pyx_k_conjuction_R[] = "conjuction_R";
static const char __pyx_k_vessel_index[] = "vessel_index";
static const char __pyx_k_conjuction_Jr[] = "conjuction_Jr";
static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
static const char __pyx_k_interpolate_R0[] = "interpolate_R0";
static const char __pyx_k_pressure_visco[] = "pressure_visco";
static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
static const char __pyx_k_interpolate_R0m[] = "interpolate_R0m";
static const char __pyx_k_interpolate_R0p[] = "interpolate_R0p";
static const char __pyx_k_pylsewave_cynum[] = "pylsewave.cynum";
static const char __pyx_k_vessel_index_list[] = "vessel_index_list";
static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
static const char __pyx_k_Georgios_E_Ragkousis[] = "Georgios E. Ragkousis";
static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
static const char __pyx_k_Solver_set_to_dt_0_9f[] = "Solver set to dt=%0.9f";
static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
static const char __pyx_k_set_boundary_layer_th[] = "set_boundary_layer_th";
static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
static const char __pyx_k_advance_Godunov_splitting[] = "_advance_Godunov_splitting";
static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
static const char __pyx_k_This_is_a_Cython_file_with_clas[] = "\nThis is a Cython file with classes for pylsewave toolkit. Cython translates everything to C++.\nThis module contains solvers that support OPENMP (via Cython OpenMP) for parallel CPU calcs.\n";
static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
static const char __pyx_k_C_gitRepositories_github_pylsewa[] = "C:\\gitRepositories\\github\\pylsewave\\pylsewave\\cynum.pyx";
static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
static const char __pyx_k_No_value_specified_for_struct_at[] = "No value specified for struct attribute 'r0'";
static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
static const char __pyx_k_Solver_failed_in_vessel_d_in_tim[] = "Solver failed in vessel %d in time increment %d  spatial %d and lenght=%d";
static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static const char __pyx_k_No_value_specified_for_struct_at_2[] = "No value specified for struct attribute 'f_r0'";
static const char __pyx_k_No_value_specified_for_struct_at_3[] = "No value specified for struct attribute 'interpolate_R0p'";
static const char __pyx_k_No_value_specified_for_struct_at_4[] = "No value specified for struct attribute 'interpolate_R0m'";
static const char __pyx_k_No_value_specified_for_struct_at_5[] = "No value specified for struct attribute 'f_r0_ph'";
static const char __pyx_k_No_value_specified_for_struct_at_6[] = "No value specified for struct attribute 'f_r0_mh'";
static const char __pyx_k_No_value_specified_for_struct_at_7[] = "No value specified for struct attribute 'df_dr0'";
static const char __pyx_k_No_value_specified_for_struct_at_8[] = "No value specified for struct attribute 'df_dx'";
static const char __pyx_k_No_value_specified_for_struct_at_9[] = "No value specified for struct attribute 'df_dr0_ph'";
static const char __pyx_k_No_value_specified_for_struct_at_10[] = "No value specified for struct attribute 'df_dx_ph'";
static const char __pyx_k_No_value_specified_for_struct_at_11[] = "No value specified for struct attribute 'df_dr0_mh'";
static const char __pyx_k_No_value_specified_for_struct_at_12[] = "No value specified for struct attribute 'df_dx_mh'";
static const char __pyx_k_No_value_specified_for_struct_at_13[] = "No value specified for struct attribute 'L'";
static const char __pyx_k_No_value_specified_for_struct_at_14[] = "No value specified for struct attribute 'dx'";
static const char __pyx_k_No_value_specified_for_struct_at_15[] = "No value specified for struct attribute 'phi'";
static const char __pyx_k_No_value_specified_for_struct_at_16[] = "No value specified for struct attribute 'RLC'";
static const char __pyx_k_No_value_specified_for_struct_at_17[] = "No value specified for struct attribute 'x_hyper'";
static const char __pyx_k_No_value_specified_for_struct_at_18[] = "No value specified for struct attribute 'a'";
static const char __pyx_k_No_value_specified_for_struct_at_19[] = "No value specified for struct attribute 'b'";
static const char __pyx_k_No_value_specified_for_struct_at_20[] = "No value specified for struct attribute 'c'";
static const char __pyx_k_No_value_specified_for_struct_at_21[] = "No value specified for struct attribute 'd'";
static const char __pyx_k_No_value_specified_for_struct_at_22[] = "No value specified for struct attribute 'a_ph'";
static const char __pyx_k_No_value_specified_for_struct_at_23[] = "No value specified for struct attribute 'a_mh'";
static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
static PyObject *__pyx_n_s_CV_f;
static PyObject *__pyx_kp_s_C_gitRepositories_github_pylsewa;
static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
static PyObject *__pyx_n_s_Ellipsis;
static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
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_Georgios_E_Ragkousis;
static PyObject *__pyx_n_s_I;
static PyObject *__pyx_n_s_Id;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_L;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
static PyObject *__pyx_kp_s_MemoryView_of_r_object;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_10;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_11;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_12;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_13;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_14;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_15;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_16;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_17;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_18;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_19;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_2;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_20;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_21;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_22;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_23;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_3;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_4;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_5;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_6;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_7;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_8;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_9;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_n_s_Nx;
static PyObject *__pyx_n_b_O;
static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
static PyObject *__pyx_n_s_PRINT_STATUS;
static PyObject *__pyx_n_s_RLC;
static PyObject *__pyx_n_s_R_dist;
static PyObject *__pyx_n_s_R_prox;
static PyObject *__pyx_n_s_Re;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_kp_s_Solver_failed_in_vessel_d_in_tim;
static PyObject *__pyx_kp_s_Solver_set_to_dt_0_9f;
static PyObject *__pyx_n_s_T;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_U0_array;
static PyObject *__pyx_n_s_UBif_array;
static PyObject *__pyx_n_s_UConj_array;
static PyObject *__pyx_n_s_UL_array;
static PyObject *__pyx_n_s_U_0;
static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_WRITE_STATUS;
static PyObject *__pyx_n_s_Wall_th;
static PyObject *__pyx_n_s_Windk;
static PyObject *__pyx_n_s_a;
static PyObject *__pyx_n_s_a_mh;
static PyObject *__pyx_n_s_a_ph;
static PyObject *__pyx_n_s_advance_Godunov_splitting;
static PyObject *__pyx_n_s_allocate_buffer;
static PyObject *__pyx_n_s_arange;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_asarray;
static PyObject *__pyx_n_s_author;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_bcs;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_u_c;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_clms;
static PyObject *__pyx_n_s_clock;
static PyObject *__pyx_n_s_compute_c;
static PyObject *__pyx_n_s_compute_c_i;
static PyObject *__pyx_n_s_conjuction_Jr;
static PyObject *__pyx_n_s_conjuction_R;
static PyObject *__pyx_kp_s_contiguous_and_direct;
static PyObject *__pyx_kp_s_contiguous_and_indirect;
static PyObject *__pyx_n_s_cwrite2file;
static PyObject *__pyx_n_s_d;
static PyObject *__pyx_n_s_df_dr0;
static PyObject *__pyx_n_s_df_dr0_mh;
static PyObject *__pyx_n_s_df_dr0_ph;
static PyObject *__pyx_n_s_df_dx;
static PyObject *__pyx_n_s_df_dx_mh;
static PyObject *__pyx_n_s_df_dx_ph;
static PyObject *__pyx_n_s_dt;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dtype_is_object;
static PyObject *__pyx_n_s_dx;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_f_r0;
static PyObject *__pyx_n_s_f_r0_mh;
static PyObject *__pyx_n_s_f_r0_ph;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_filename;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_float;
static PyObject *__pyx_n_s_flux_i;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_fortran;
static PyObject *__pyx_n_u_fortran;
static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_inarr;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_inletfunc;
static PyObject *__pyx_n_s_inpdes;
static PyObject *__pyx_n_s_input_v;
static PyObject *__pyx_n_s_int;
static PyObject *__pyx_n_s_interpolate_R0;
static PyObject *__pyx_n_s_interpolate_R0m;
static PyObject *__pyx_n_s_interpolate_R0p;
static PyObject *__pyx_n_s_itemsize;
static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
static PyObject *__pyx_n_s_iteritems;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_linspace;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_memview;
static PyObject *__pyx_n_s_mesh;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_mu;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
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_ndim;
static PyObject *__pyx_n_s_no_cycles;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_out;
static PyObject *__pyx_n_s_out_c;
static PyObject *__pyx_n_s_out_f;
static PyObject *__pyx_n_s_out_p;
static PyObject *__pyx_n_s_out_s;
static PyObject *__pyx_n_s_p0;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_parStruct;
static PyObject *__pyx_n_s_phi;
static PyObject *__pyx_n_s_pi;
static PyObject *__pyx_n_s_power;
static PyObject *__pyx_n_s_pressure_visco;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_pylsewave_cynum;
static PyObject *__pyx_n_s_pyx_getbuffer;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qc;
static PyObject *__pyx_n_s_r0;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_rc;
static PyObject *__pyx_n_s_rho;
static PyObject *__pyx_n_s_round;
static PyObject *__pyx_n_s_rws;
static PyObject *__pyx_n_s_set_BC;
static PyObject *__pyx_n_s_set_T;
static PyObject *__pyx_n_s_set_boundary_layer_th;
static PyObject *__pyx_n_s_set_vessels;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_siz;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_skip_frame;
static PyObject *__pyx_n_s_solve;
static PyObject *__pyx_n_s_source_i;
static PyObject *__pyx_n_s_sqrt;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_kp_s_strided_and_direct;
static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
static PyObject *__pyx_kp_s_strided_and_indirect;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_t;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_theta;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_u;
static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_n_s_unpack;
static PyObject *__pyx_n_s_user_action;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_vec;
static PyObject *__pyx_n_s_vectorV;
static PyObject *__pyx_n_s_vectorised;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_vessel_index;
static PyObject *__pyx_n_s_vessel_index_list;
static PyObject *__pyx_n_s_vessels;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_x1;
static PyObject *__pyx_n_s_x2;
static PyObject *__pyx_n_s_x_hyper;
static PyObject *__pyx_n_s_y1;
static PyObject *__pyx_n_s_y2;
static PyObject *__pyx_n_s_zeros;
static int __pyx_pf_9pylsewave_5cynum_8cyVessel___cinit__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self, std::string __pyx_v_name, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_L, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_prox, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_dist, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Wall_th, PyObject *__pyx_v_Windk, int __pyx_v_Id, CYTHON_UNUSED PyObject *__pyx_v_rc); /* proto */
static void __pyx_pf_9pylsewave_5cynum_8cyVessel_2__dealloc__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_4name___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_1L___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_6r_prox___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_6r_dist___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_2id___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_4w_th___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_3RLC___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static int __pyx_pf_9pylsewave_5cynum_8cyVessel_3RLC_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self, PyObject *__pyx_v_dinput); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_2dx___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static int __pyx_pf_9pylsewave_5cynum_8cyVessel_2dx_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_dinput); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_1x___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_2r0___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_4f_r0___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_6df_dr0___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_5df_dx___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_7f_r0_ph___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_9df_dr0_ph___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_8df_dx_ph___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_7f_r0_mh___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_9df_dr0_mh___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_8df_dx_mh___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_1k___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_4set_k_vector(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self, PyObject *__pyx_v_input_v); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_6interpolate_R0(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_9pylsewave_5cynum_14cyVesselScaled___cinit__(struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled *__pyx_v_self, std::string __pyx_v_name, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_L, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_prox, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_dist, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Wall_th, PyObject *__pyx_v_Windk, int __pyx_v_Id, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rc); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_14cyVesselScaled_2set_k_vector(struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled *__pyx_v_self, PyObject *__pyx_v_input_v, PyObject *__pyx_v_rho, PyObject *__pyx_v_qc, PyObject *__pyx_v_rc); /* proto */
static void __pyx_pf_9pylsewave_5cynum_14cyVesselScaled_4__dealloc__(struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled *__pyx_v_self); /* proto */
static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork___cinit__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_vec, PyObject *__pyx_v_vessels, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_p0, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rho, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Re, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_dx, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Nx, CYTHON_UNUSED __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_qc, CYTHON_UNUSED __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rc); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_7vessels___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2dx___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2dx_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, PyObject *__pyx_v_indx); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2p0___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2p0_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, PyObject *__pyx_v_inp0); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2Re___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2Re_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, PyObject *__pyx_v_inRe); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_3rho___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_3rho_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, PyObject *__pyx_v_inrho); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_5delta___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_5delta_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, PyObject *__pyx_v_indelta); /* proto */
static void __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2__dealloc__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self); /* proto */
static int __pyx_pf_9pylsewave_5cynum_17cyVesselNetworkSc___cinit__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc *__pyx_v_self, struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_vec, PyObject *__pyx_v_vessels, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_p0, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rho, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Re, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_dx, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Nx, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_qc, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rc); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_17cyVesselNetworkSc_2set_boundary_layer_th(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc *__pyx_v_self, PyObject *__pyx_v_T, PyObject *__pyx_v_no_cycles); /* proto */
static void __pyx_pf_9pylsewave_5cynum_17cyVesselNetworkSc_4__dealloc__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_pystd_dev(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_2pytdma(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_b, PyArrayObject *__pyx_v_c, PyArrayObject *__pyx_v_d, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_4cpwgrad(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inarr, PyArrayObject *__pyx_v_out, double __pyx_v_dx); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_6cwrite2file(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_filename, __Pyx_memviewslice __pyx_v_u); /* proto */
static int __pyx_pf_9pylsewave_5cynum_5cPDEm___init__(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, PyObject *__pyx_v_mesh, PyObject *__pyx_v_rho, PyObject *__pyx_v_mu, PyObject *__pyx_v_Re); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_2set_boundary_layer_th(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, double __pyx_v_T, int __pyx_v_no_cycles); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_5delta___get__(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_4set_vessels(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_v_vectorV, int __pyx_v_siz); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_6flux_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_4mesh___get__(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self); /* proto */
static int __pyx_pf_9pylsewave_5cynum_5cPDEm_4mesh_2__set__(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, PyObject *__pyx_v_mesh); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_8source_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_10compute_c_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_12compute_c(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cPDEsWat_compute_c_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cPDEsWat_2compute_c(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cPDEsWat_4flux_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8cPDEsWat_6source_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_13cPDEsWatVisco_set_vessels(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_v_vectorV, int __pyx_v_siz); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_13cPDEsWatVisco_2pressure_visco(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_p); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_13cPDEsWatVisco_4CV_f(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_6PDEmCs_flux_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_6PDEmCs_4mesh___get__(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_6PDEmCs_2source_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_6PDEmCs_4compute_c_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_6PDEmCs_6compute_c(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c); /* proto */
static int __pyx_pf_9pylsewave_5cynum_4cBCs___init__(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_inpdes, PyObject *__pyx_v_inletfunc); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_4cBCs_2U_0(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_4cBCs_4I(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, double __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_4cBCs_6conjuction_R(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_4cBCs_8conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_7cBCsWat_U_0(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_7cBCsWat_2conjuction_R(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_7cBCsWat_4conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_5BCsSc_conjuction_R(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_5BCsSc_2conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_4BCsD_U_0(struct __pyx_obj_9pylsewave_5cynum_BCsD *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_9BCsADAN56_U_0(struct __pyx_obj_9pylsewave_5cynum_BCsADAN56 *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_U_0(struct __pyx_obj_9pylsewave_5cynum_cBCsHandModelNonReflBcs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out); /* proto */
static int __pyx_pf_9pylsewave_5cynum_10cFDMSolver___init__(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_bcs); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_10cFDMSolver_4mesh___get__(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_10cFDMSolver_2set_T(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, double __pyx_v_dt, double __pyx_v_T, int __pyx_v_no_cycles); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_10cFDMSolver_4set_BC(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, __Pyx_memviewslice __pyx_v_U0_array, __Pyx_memviewslice __pyx_v_UL_array, __Pyx_memviewslice __pyx_v_UBif_array, __Pyx_memviewslice __pyx_v_UConj_array); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_10cFDMSolver_6solve(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, PyObject *__pyx_v_user_action, PyObject *__pyx_v_version); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver__advance_Godunov_splitting(struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *__pyx_v_self, struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj __pyx_v_parStruct, __Pyx_memviewslice __pyx_v_u, int __pyx_v_n, double __pyx_v_dt, double __pyx_v_dx, int __pyx_v_vessel_index, double __pyx_v_theta); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_2solve(struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *__pyx_v_self, PyObject *__pyx_v_user_action, PyObject *__pyx_v_version); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_8norm2(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_10dotVec(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b); /* proto */
static PyObject *__pyx_pf_9pylsewave_5cynum_12linear_extrapolation(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, double __pyx_v_x1, double __pyx_v_x2, double __pyx_v_y1, double __pyx_v_y2); /* 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 int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cyVessel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cyVesselScaled(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cyVesselNetwork(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cyVesselNetworkSc(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cPDEm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cPDEsWat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cPDEsWatVisco(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_PDEmCs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cBCs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cBCsWat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_BCsSc(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_BCsD(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_BCsADAN56(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cBCsHandModelNonReflBcs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cFDMSolver(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cLaxWendroffSolver(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cMacCormackSolver(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pylsewave_5cynum_cMacCormackGodunovSplitSolver(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_float_2_;
static PyObject *__pyx_float_4_;
static PyObject *__pyx_float_0_0;
static PyObject *__pyx_float_0_5;
static PyObject *__pyx_float_2_0;
static PyObject *__pyx_float_neg_0_5;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_k_;
static PyObject *__pyx_k__2;
static PyObject *__pyx_slice__7;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__54;
static PyObject *__pyx_slice__55;
static PyObject *__pyx_slice__56;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_codeobj__59;

/* "pylsewave/cynum.pyx":34
 *     cdef Vessel *thisptr
 * 
 *     def __cinit__(self, string name, DTYPE_t L, DTYPE_t R_prox, DTYPE_t R_dist,             # <<<<<<<<<<<<<<
 *                   DTYPE_t Wall_th, dict Windk = dict(), int Id = 0, rc=0):
 *         if type(self) is cyVessel:
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_8cyVessel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_8cyVessel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  std::string __pyx_v_name;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_L;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_prox;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_dist;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Wall_th;
  PyObject *__pyx_v_Windk = 0;
  int __pyx_v_Id;
  CYTHON_UNUSED PyObject *__pyx_v_rc = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_L,&__pyx_n_s_R_prox,&__pyx_n_s_R_dist,&__pyx_n_s_Wall_th,&__pyx_n_s_Windk,&__pyx_n_s_Id,&__pyx_n_s_rc,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    values[5] = __pyx_k_;
    values[7] = ((PyObject *)__pyx_int_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  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 5, 8, 1); __PYX_ERR(0, 34, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_R_prox)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 5, 8, 2); __PYX_ERR(0, 34, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_R_dist)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 5, 8, 3); __PYX_ERR(0, 34, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Wall_th)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 5, 8, 4); __PYX_ERR(0, 34, __pyx_L3_error)
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Windk);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Id);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rc);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 34, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error)
    __pyx_v_L = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_L == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error)
    __pyx_v_R_prox = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_R_prox == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error)
    __pyx_v_R_dist = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_R_dist == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error)
    __pyx_v_Wall_th = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_Wall_th == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error)
    __pyx_v_Windk = ((PyObject*)values[5]);
    if (values[6]) {
      __pyx_v_Id = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_Id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error)
    } else {
      __pyx_v_Id = ((int)0);
    }
    __pyx_v_rc = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 5, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 34, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Windk), (&PyDict_Type), 1, "Windk", 1))) __PYX_ERR(0, 35, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel___cinit__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self), __pyx_v_name, __pyx_v_L, __pyx_v_R_prox, __pyx_v_R_dist, __pyx_v_Wall_th, __pyx_v_Windk, __pyx_v_Id, __pyx_v_rc);

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

static int __pyx_pf_9pylsewave_5cynum_8cyVessel___cinit__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self, std::string __pyx_v_name, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_L, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_prox, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_dist, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Wall_th, PyObject *__pyx_v_Windk, int __pyx_v_Id, CYTHON_UNUSED PyObject *__pyx_v_rc) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  std::map<std::string,double>  __pyx_t_3;
  Vessel *__pyx_t_4;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pylsewave/cynum.pyx":36
 *     def __cinit__(self, string name, DTYPE_t L, DTYPE_t R_prox, DTYPE_t R_dist,
 *                   DTYPE_t Wall_th, dict Windk = dict(), int Id = 0, rc=0):
 *         if type(self) is cyVessel:             # <<<<<<<<<<<<<<
 *             self.thisptr = new Vessel(name, L, R_prox, R_dist, Wall_th, Windk, Id)
 * 
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_9pylsewave_5cynum_cyVessel));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pylsewave/cynum.pyx":37
 *                   DTYPE_t Wall_th, dict Windk = dict(), int Id = 0, rc=0):
 *         if type(self) is cyVessel:
 *             self.thisptr = new Vessel(name, L, R_prox, R_dist, Wall_th, Windk, Id)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_3 = __pyx_convert_map_from_py_std_3a__3a_string__and_double(__pyx_v_Windk); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L1_error)
    try {
      __pyx_t_4 = new Vessel(__pyx_v_name, __pyx_v_L, __pyx_v_R_prox, __pyx_v_R_dist, __pyx_v_Wall_th, __pyx_t_3, __pyx_v_Id);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 37, __pyx_L1_error)
    }
    __pyx_v_self->thisptr = __pyx_t_4;

    /* "pylsewave/cynum.pyx":36
 *     def __cinit__(self, string name, DTYPE_t L, DTYPE_t R_prox, DTYPE_t R_dist,
 *                   DTYPE_t Wall_th, dict Windk = dict(), int Id = 0, rc=0):
 *         if type(self) is cyVessel:             # <<<<<<<<<<<<<<
 *             self.thisptr = new Vessel(name, L, R_prox, R_dist, Wall_th, Windk, Id)
 * 
 */
  }

  /* "pylsewave/cynum.pyx":34
 *     cdef Vessel *thisptr
 * 
 *     def __cinit__(self, string name, DTYPE_t L, DTYPE_t R_prox, DTYPE_t R_dist,             # <<<<<<<<<<<<<<
 *                   DTYPE_t Wall_th, dict Windk = dict(), int Id = 0, rc=0):
 *         if type(self) is cyVessel:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":39
 *             self.thisptr = new Vessel(name, L, R_prox, R_dist, Wall_th, Windk, Id)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is cyVessel:
 *             del self.thisptr
 */

/* Python wrapper */
static void __pyx_pw_9pylsewave_5cynum_8cyVessel_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_9pylsewave_5cynum_8cyVessel_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_9pylsewave_5cynum_8cyVessel_2__dealloc__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static void __pyx_pf_9pylsewave_5cynum_8cyVessel_2__dealloc__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pylsewave/cynum.pyx":40
 * 
 *     def __dealloc__(self):
 *         if type(self) is cyVessel:             # <<<<<<<<<<<<<<
 *             del self.thisptr
 * 
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_9pylsewave_5cynum_cyVessel));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pylsewave/cynum.pyx":41
 *     def __dealloc__(self):
 *         if type(self) is cyVessel:
 *             del self.thisptr             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    delete __pyx_v_self->thisptr;

    /* "pylsewave/cynum.pyx":40
 * 
 *     def __dealloc__(self):
 *         if type(self) is cyVessel:             # <<<<<<<<<<<<<<
 *             del self.thisptr
 * 
 */
  }

  /* "pylsewave/cynum.pyx":39
 *             self.thisptr = new Vessel(name, L, R_prox, R_dist, Wall_th, Windk, Id)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is cyVessel:
 *             del self.thisptr
 */

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

/* "pylsewave/cynum.pyx":44
 * 
 *     @property
 *     def name(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getName()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_4name___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_4name___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":45
 *     @property
 *     def name(self):
 *         return self.thisptr.getName()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->thisptr->getName()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":44
 * 
 *     @property
 *     def name(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getName()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":48
 * 
 *     @property
 *     def L(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getL()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_1L_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_1L_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_1L___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_1L___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":49
 *     @property
 *     def L(self):
 *         return self.thisptr.getL()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->getL()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":48
 * 
 *     @property
 *     def L(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getL()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.L.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":52
 * 
 *     @property
 *     def r_prox(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getRadius_prox()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_6r_prox_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_6r_prox_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_6r_prox___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_6r_prox___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":53
 *     @property
 *     def r_prox(self):
 *         return self.thisptr.getRadius_prox()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->getRadius_prox()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":52
 * 
 *     @property
 *     def r_prox(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getRadius_prox()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.r_prox.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":56
 * 
 *     @property
 *     def r_dist(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getRadius_dist()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_6r_dist_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_6r_dist_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_6r_dist___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_6r_dist___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":57
 *     @property
 *     def r_dist(self):
 *         return self.thisptr.getRadius_dist()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->getRadius_dist()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":56
 * 
 *     @property
 *     def r_dist(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getRadius_dist()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.r_dist.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":60
 * 
 *     @property
 *     def id(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getId()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_2id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_2id_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_2id___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_2id___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":61
 *     @property
 *     def id(self):
 *         return self.thisptr.getId()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->getId()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":60
 * 
 *     @property
 *     def id(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getId()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":64
 * 
 *     @property
 *     def w_th(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getWall_th()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_4w_th_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_4w_th_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_4w_th___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_4w_th___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":65
 *     @property
 *     def w_th(self):
 *         return self.thisptr.getWall_th()             # <<<<<<<<<<<<<<
 * 
 *     property RLC:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->getWall_th()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":64
 * 
 *     @property
 *     def w_th(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.getWall_th()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.w_th.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":68
 * 
 *     property RLC:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.thisptr.getRLC()
 *         def __set__(self, dict dinput):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_3RLC_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_3RLC_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_3RLC___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_3RLC___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":69
 *     property RLC:
 *         def __get__(self):
 *             return self.thisptr.getRLC()             # <<<<<<<<<<<<<<
 *         def __set__(self, dict dinput):
 *             self.thisptr.setRLC(dinput)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_map_to_py_std_3a__3a_string____double(__pyx_v_self->thisptr->getRLC()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":68
 * 
 *     property RLC:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.thisptr.getRLC()
 *         def __set__(self, dict dinput):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.RLC.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":70
 *         def __get__(self):
 *             return self.thisptr.getRLC()
 *         def __set__(self, dict dinput):             # <<<<<<<<<<<<<<
 *             self.thisptr.setRLC(dinput)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_8cyVessel_3RLC_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_dinput); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_8cyVessel_3RLC_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_dinput) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dinput), (&PyDict_Type), 1, "dinput", 1))) __PYX_ERR(0, 70, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_3RLC_2__set__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self), ((PyObject*)__pyx_v_dinput));

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

static int __pyx_pf_9pylsewave_5cynum_8cyVessel_3RLC_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self, PyObject *__pyx_v_dinput) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::map<std::string,double>  __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pylsewave/cynum.pyx":71
 *             return self.thisptr.getRLC()
 *         def __set__(self, dict dinput):
 *             self.thisptr.setRLC(dinput)             # <<<<<<<<<<<<<<
 * 
 *     property dx:
 */
  __pyx_t_1 = __pyx_convert_map_from_py_std_3a__3a_string__and_double(__pyx_v_dinput); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
  __pyx_v_self->thisptr->setRLC(__pyx_t_1);

  /* "pylsewave/cynum.pyx":70
 *         def __get__(self):
 *             return self.thisptr.getRLC()
 *         def __set__(self, dict dinput):             # <<<<<<<<<<<<<<
 *             self.thisptr.setRLC(dinput)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.RLC.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":74
 * 
 *     property dx:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.thisptr.getdx()
 *         def __set__(self, DTYPE_t dinput):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_2dx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_2dx_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_2dx___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_2dx___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":75
 *     property dx:
 *         def __get__(self):
 *             return self.thisptr.getdx()             # <<<<<<<<<<<<<<
 *         def __set__(self, DTYPE_t dinput):
 *             self.thisptr.setdx(dinput)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->getdx()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":74
 * 
 *     property dx:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.thisptr.getdx()
 *         def __set__(self, DTYPE_t dinput):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.dx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":76
 *         def __get__(self):
 *             return self.thisptr.getdx()
 *         def __set__(self, DTYPE_t dinput):             # <<<<<<<<<<<<<<
 *             self.thisptr.setdx(dinput)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_8cyVessel_2dx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_dinput); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_8cyVessel_2dx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_dinput) {
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_dinput;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_dinput); {
    __pyx_v_dinput = __pyx_PyFloat_AsDouble(__pyx_arg_dinput); if (unlikely((__pyx_v_dinput == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.dx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_2dx_2__set__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self), ((__pyx_t_9pylsewave_5cynum_DTYPE_t)__pyx_v_dinput));

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

static int __pyx_pf_9pylsewave_5cynum_8cyVessel_2dx_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_dinput) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pylsewave/cynum.pyx":77
 *             return self.thisptr.getdx()
 *         def __set__(self, DTYPE_t dinput):
 *             self.thisptr.setdx(dinput)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->thisptr->setdx(__pyx_v_dinput);

  /* "pylsewave/cynum.pyx":76
 *         def __get__(self):
 *             return self.thisptr.getdx()
 *         def __set__(self, DTYPE_t dinput):             # <<<<<<<<<<<<<<
 *             self.thisptr.setdx(dinput)
 * 
 */

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

/* "pylsewave/cynum.pyx":80
 * 
 *     @property
 *     def x(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_x())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_1x_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_1x_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_1x___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_1x___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":81
 *     @property
 *     def x(self):
 *         return np.asarray(self.thisptr.get_x())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->get_x()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":80
 * 
 *     @property
 *     def x(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_x())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.x.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":84
 * 
 *     @property
 *     def r0(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.getR0())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_2r0_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_2r0_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_2r0___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_2r0___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":85
 *     @property
 *     def r0(self):
 *         return np.asarray(self.thisptr.getR0())             # <<<<<<<<<<<<<<
 * 
 *     # @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->getR0()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":84
 * 
 *     @property
 *     def r0(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.getR0())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.r0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":92
 * 
 *     @property
 *     def f_r0(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_f_R0())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_4f_r0_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_4f_r0_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_4f_r0___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_4f_r0___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":93
 *     @property
 *     def f_r0(self):
 *         return np.asarray(self.thisptr.get_f_R0())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->get_f_R0()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":92
 * 
 *     @property
 *     def f_r0(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_f_R0())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.f_r0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":96
 * 
 *     @property
 *     def df_dr0(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dR0())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_6df_dr0_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_6df_dr0_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_6df_dr0___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_6df_dr0___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":97
 *     @property
 *     def df_dr0(self):
 *         return np.asarray(self.thisptr.get_df_dR0())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->get_df_dR0()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":96
 * 
 *     @property
 *     def df_dr0(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dR0())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.df_dr0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":100
 * 
 *     @property
 *     def df_dx(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dx())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_5df_dx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_5df_dx_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_5df_dx___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_5df_dx___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":101
 *     @property
 *     def df_dx(self):
 *         return np.asarray(self.thisptr.get_df_dx())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->get_df_dx()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":100
 * 
 *     @property
 *     def df_dx(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dx())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.df_dx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":104
 * 
 *     @property
 *     def f_r0_ph(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_f_R0_ph())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_7f_r0_ph_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_7f_r0_ph_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_7f_r0_ph___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_7f_r0_ph___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":105
 *     @property
 *     def f_r0_ph(self):
 *         return np.asarray(self.thisptr.get_f_R0_ph())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->get_f_R0_ph()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":104
 * 
 *     @property
 *     def f_r0_ph(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_f_R0_ph())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.f_r0_ph.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":108
 * 
 *     @property
 *     def df_dr0_ph(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dR0_ph())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_9df_dr0_ph_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_9df_dr0_ph_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_9df_dr0_ph___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_9df_dr0_ph___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":109
 *     @property
 *     def df_dr0_ph(self):
 *         return np.asarray(self.thisptr.get_df_dR0_ph())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->get_df_dR0_ph()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":108
 * 
 *     @property
 *     def df_dr0_ph(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dR0_ph())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.df_dr0_ph.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":112
 * 
 *     @property
 *     def df_dx_ph(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dx_ph())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_8df_dx_ph_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_8df_dx_ph_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_8df_dx_ph___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_8df_dx_ph___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":113
 *     @property
 *     def df_dx_ph(self):
 *         return np.asarray(self.thisptr.get_df_dx_ph())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->get_df_dx_ph()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":112
 * 
 *     @property
 *     def df_dx_ph(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dx_ph())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.df_dx_ph.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":116
 * 
 *     @property
 *     def f_r0_mh(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_f_R0_mh())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_7f_r0_mh_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_7f_r0_mh_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_7f_r0_mh___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_7f_r0_mh___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":117
 *     @property
 *     def f_r0_mh(self):
 *         return np.asarray(self.thisptr.get_f_R0_mh())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->get_f_R0_mh()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":116
 * 
 *     @property
 *     def f_r0_mh(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_f_R0_mh())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.f_r0_mh.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":120
 * 
 *     @property
 *     def df_dr0_mh(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dR0_mh())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_9df_dr0_mh_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_9df_dr0_mh_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_9df_dr0_mh___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_9df_dr0_mh___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":121
 *     @property
 *     def df_dr0_mh(self):
 *         return np.asarray(self.thisptr.get_df_dR0_mh())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->get_df_dR0_mh()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":120
 * 
 *     @property
 *     def df_dr0_mh(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dR0_mh())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.df_dr0_mh.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":124
 * 
 *     @property
 *     def df_dx_mh(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dx_mh())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_8df_dx_mh_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_8df_dx_mh_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_8df_dx_mh___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_8df_dx_mh___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":125
 *     @property
 *     def df_dx_mh(self):
 *         return np.asarray(self.thisptr.get_df_dx_mh())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->get_df_dx_mh()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":124
 * 
 *     @property
 *     def df_dx_mh(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_df_dx_mh())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.df_dx_mh.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":128
 * 
 *     @property
 *     def k(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_k_vector())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_1k_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_1k_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_1k___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_1k___get__(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":129
 *     @property
 *     def k(self):
 *         return np.asarray(self.thisptr.get_k_vector())             # <<<<<<<<<<<<<<
 * 
 *     def set_k_vector(self, input_v):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->get_k_vector()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":128
 * 
 *     @property
 *     def k(self):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.get_k_vector())
 * 
 */

  /* 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("pylsewave.cynum.cyVessel.k.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":131
 *         return np.asarray(self.thisptr.get_k_vector())
 * 
 *     def set_k_vector(self, input_v):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_k_vector(input_v)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_5set_k_vector(PyObject *__pyx_v_self, PyObject *__pyx_v_input_v); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_5set_k_vector(PyObject *__pyx_v_self, PyObject *__pyx_v_input_v) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_k_vector (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_4set_k_vector(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self), ((PyObject *)__pyx_v_input_v));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_4set_k_vector(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self, PyObject *__pyx_v_input_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<double>  __pyx_t_1;
  __Pyx_RefNannySetupContext("set_k_vector", 0);

  /* "pylsewave/cynum.pyx":132
 * 
 *     def set_k_vector(self, input_v):
 *         self.thisptr.set_k_vector(input_v)             # <<<<<<<<<<<<<<
 * 
 *     def interpolate_R0(self, value):
 */
  __pyx_t_1 = __pyx_convert_vector_from_py_double(__pyx_v_input_v); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
  __pyx_v_self->thisptr->set_k_vector(__pyx_t_1);

  /* "pylsewave/cynum.pyx":131
 *         return np.asarray(self.thisptr.get_k_vector())
 * 
 *     def set_k_vector(self, input_v):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_k_vector(input_v)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.set_k_vector", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":134
 *         self.thisptr.set_k_vector(input_v)
 * 
 *     def interpolate_R0(self, value):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.interpolate_R0(value))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_7interpolate_R0(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_8cyVessel_7interpolate_R0(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("interpolate_R0 (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cyVessel_6interpolate_R0(((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cyVessel_6interpolate_R0(struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  double __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("interpolate_R0", 0);

  /* "pylsewave/cynum.pyx":135
 * 
 *     def interpolate_R0(self, value):
 *         return np.asarray(self.thisptr.interpolate_R0(value))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_self->thisptr->interpolate_R0(__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":134
 *         self.thisptr.set_k_vector(input_v)
 * 
 *     def interpolate_R0(self, value):             # <<<<<<<<<<<<<<
 *         return np.asarray(self.thisptr.interpolate_R0(value))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pylsewave.cynum.cyVessel.interpolate_R0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":140
 * cdef class cyVesselScaled(cyVessel):
 *     cdef VesselScaled *thisptrDerived
 *     def __cinit__(self, string name, DTYPE_t L, DTYPE_t R_prox, DTYPE_t R_dist,             # <<<<<<<<<<<<<<
 *                   DTYPE_t Wall_th, dict Windk=dict(), int Id=0, DTYPE_t rc=1.0):
 *         if type(self) is cyVesselScaled:
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_14cyVesselScaled_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_14cyVesselScaled_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  std::string __pyx_v_name;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_L;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_prox;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_dist;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Wall_th;
  PyObject *__pyx_v_Windk = 0;
  int __pyx_v_Id;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rc;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_L,&__pyx_n_s_R_prox,&__pyx_n_s_R_dist,&__pyx_n_s_Wall_th,&__pyx_n_s_Windk,&__pyx_n_s_Id,&__pyx_n_s_rc,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    values[5] = __pyx_k__2;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 5, 8, 1); __PYX_ERR(0, 140, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_R_prox)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 5, 8, 2); __PYX_ERR(0, 140, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_R_dist)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 5, 8, 3); __PYX_ERR(0, 140, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Wall_th)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 5, 8, 4); __PYX_ERR(0, 140, __pyx_L3_error)
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Windk);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Id);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rc);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 140, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L3_error)
    __pyx_v_L = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_L == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L3_error)
    __pyx_v_R_prox = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_R_prox == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L3_error)
    __pyx_v_R_dist = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_R_dist == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L3_error)
    __pyx_v_Wall_th = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_Wall_th == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L3_error)
    __pyx_v_Windk = ((PyObject*)values[5]);
    if (values[6]) {
      __pyx_v_Id = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_Id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L3_error)
    } else {
      __pyx_v_Id = ((int)0);
    }
    if (values[7]) {
      __pyx_v_rc = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_rc == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L3_error)
    } else {
      __pyx_v_rc = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)1.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 5, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 140, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselScaled.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Windk), (&PyDict_Type), 1, "Windk", 1))) __PYX_ERR(0, 141, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pylsewave_5cynum_14cyVesselScaled___cinit__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled *)__pyx_v_self), __pyx_v_name, __pyx_v_L, __pyx_v_R_prox, __pyx_v_R_dist, __pyx_v_Wall_th, __pyx_v_Windk, __pyx_v_Id, __pyx_v_rc);

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

static int __pyx_pf_9pylsewave_5cynum_14cyVesselScaled___cinit__(struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled *__pyx_v_self, std::string __pyx_v_name, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_L, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_prox, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_R_dist, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Wall_th, PyObject *__pyx_v_Windk, int __pyx_v_Id, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rc) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  std::map<std::string,double>  __pyx_t_3;
  VesselScaled *__pyx_t_4;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pylsewave/cynum.pyx":142
 *     def __cinit__(self, string name, DTYPE_t L, DTYPE_t R_prox, DTYPE_t R_dist,
 *                   DTYPE_t Wall_th, dict Windk=dict(), int Id=0, DTYPE_t rc=1.0):
 *         if type(self) is cyVesselScaled:             # <<<<<<<<<<<<<<
 *             self.thisptrDerived = self.thisptr = new VesselScaled(name, L, R_prox, R_dist, Wall_th, Windk, Id, rc)
 * #            self.thisptrDerived = <Vessel *>(new VesselScaled(name, L, R_prox, R_dist, Wall_th, Windk, Id, rc))
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_9pylsewave_5cynum_cyVesselScaled));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pylsewave/cynum.pyx":143
 *                   DTYPE_t Wall_th, dict Windk=dict(), int Id=0, DTYPE_t rc=1.0):
 *         if type(self) is cyVesselScaled:
 *             self.thisptrDerived = self.thisptr = new VesselScaled(name, L, R_prox, R_dist, Wall_th, Windk, Id, rc)             # <<<<<<<<<<<<<<
 * #            self.thisptrDerived = <Vessel *>(new VesselScaled(name, L, R_prox, R_dist, Wall_th, Windk, Id, rc))
 * 
 */
    __pyx_t_3 = __pyx_convert_map_from_py_std_3a__3a_string__and_double(__pyx_v_Windk); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error)
    try {
      __pyx_t_4 = new VesselScaled(__pyx_v_name, __pyx_v_L, __pyx_v_R_prox, __pyx_v_R_dist, __pyx_v_Wall_th, __pyx_t_3, __pyx_v_Id, __pyx_v_rc);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 143, __pyx_L1_error)
    }
    __pyx_v_self->thisptrDerived = __pyx_t_4;
    __pyx_v_self->__pyx_base.thisptr = __pyx_t_4;

    /* "pylsewave/cynum.pyx":142
 *     def __cinit__(self, string name, DTYPE_t L, DTYPE_t R_prox, DTYPE_t R_dist,
 *                   DTYPE_t Wall_th, dict Windk=dict(), int Id=0, DTYPE_t rc=1.0):
 *         if type(self) is cyVesselScaled:             # <<<<<<<<<<<<<<
 *             self.thisptrDerived = self.thisptr = new VesselScaled(name, L, R_prox, R_dist, Wall_th, Windk, Id, rc)
 * #            self.thisptrDerived = <Vessel *>(new VesselScaled(name, L, R_prox, R_dist, Wall_th, Windk, Id, rc))
 */
  }

  /* "pylsewave/cynum.pyx":140
 * cdef class cyVesselScaled(cyVessel):
 *     cdef VesselScaled *thisptrDerived
 *     def __cinit__(self, string name, DTYPE_t L, DTYPE_t R_prox, DTYPE_t R_dist,             # <<<<<<<<<<<<<<
 *                   DTYPE_t Wall_th, dict Windk=dict(), int Id=0, DTYPE_t rc=1.0):
 *         if type(self) is cyVesselScaled:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselScaled.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":146
 * #            self.thisptrDerived = <Vessel *>(new VesselScaled(name, L, R_prox, R_dist, Wall_th, Windk, Id, rc))
 * 
 *     def set_k_vector(self, input_v, rho=0, qc=0, rc=0):             # <<<<<<<<<<<<<<
 *         self.thisptrDerived.set_k_vector(input_v, rho, qc, rc)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_14cyVesselScaled_3set_k_vector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_14cyVesselScaled_3set_k_vector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_input_v = 0;
  PyObject *__pyx_v_rho = 0;
  PyObject *__pyx_v_qc = 0;
  PyObject *__pyx_v_rc = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_k_vector (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_v,&__pyx_n_s_rho,&__pyx_n_s_qc,&__pyx_n_s_rc,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_int_0);
    values[3] = ((PyObject *)__pyx_int_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_input_v)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rho);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qc);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rc);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_k_vector") < 0)) __PYX_ERR(0, 146, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_input_v = values[0];
    __pyx_v_rho = values[1];
    __pyx_v_qc = values[2];
    __pyx_v_rc = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_k_vector", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselScaled.set_k_vector", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_14cyVesselScaled_2set_k_vector(((struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled *)__pyx_v_self), __pyx_v_input_v, __pyx_v_rho, __pyx_v_qc, __pyx_v_rc);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_14cyVesselScaled_2set_k_vector(struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled *__pyx_v_self, PyObject *__pyx_v_input_v, PyObject *__pyx_v_rho, PyObject *__pyx_v_qc, PyObject *__pyx_v_rc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<double>  __pyx_t_1;
  double __pyx_t_2;
  double __pyx_t_3;
  double __pyx_t_4;
  __Pyx_RefNannySetupContext("set_k_vector", 0);

  /* "pylsewave/cynum.pyx":147
 * 
 *     def set_k_vector(self, input_v, rho=0, qc=0, rc=0):
 *         self.thisptrDerived.set_k_vector(input_v, rho, qc, rc)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = __pyx_convert_vector_from_py_double(__pyx_v_input_v); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_rho); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_qc); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_rc); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
  __pyx_v_self->thisptrDerived->set_k_vector(__pyx_t_1, __pyx_t_2, __pyx_t_3, __pyx_t_4);

  /* "pylsewave/cynum.pyx":146
 * #            self.thisptrDerived = <Vessel *>(new VesselScaled(name, L, R_prox, R_dist, Wall_th, Windk, Id, rc))
 * 
 *     def set_k_vector(self, input_v, rho=0, qc=0, rc=0):             # <<<<<<<<<<<<<<
 *         self.thisptrDerived.set_k_vector(input_v, rho, qc, rc)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselScaled.set_k_vector", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":149
 *         self.thisptrDerived.set_k_vector(input_v, rho, qc, rc)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is cyVesselScaled:
 *             del self.thisptrDerived
 */

/* Python wrapper */
static void __pyx_pw_9pylsewave_5cynum_14cyVesselScaled_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_9pylsewave_5cynum_14cyVesselScaled_5__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_9pylsewave_5cynum_14cyVesselScaled_4__dealloc__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled *)__pyx_v_self));

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

static void __pyx_pf_9pylsewave_5cynum_14cyVesselScaled_4__dealloc__(struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pylsewave/cynum.pyx":150
 * 
 *     def __dealloc__(self):
 *         if type(self) is cyVesselScaled:             # <<<<<<<<<<<<<<
 *             del self.thisptrDerived
 * 
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_9pylsewave_5cynum_cyVesselScaled));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pylsewave/cynum.pyx":151
 *     def __dealloc__(self):
 *         if type(self) is cyVesselScaled:
 *             del self.thisptrDerived             # <<<<<<<<<<<<<<
 * 
 * cdef class cyVesselNetwork(object):
 */
    delete __pyx_v_self->thisptrDerived;

    /* "pylsewave/cynum.pyx":150
 * 
 *     def __dealloc__(self):
 *         if type(self) is cyVesselScaled:             # <<<<<<<<<<<<<<
 *             del self.thisptrDerived
 * 
 */
  }

  /* "pylsewave/cynum.pyx":149
 *         self.thisptrDerived.set_k_vector(input_v, rho, qc, rc)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is cyVesselScaled:
 *             del self.thisptrDerived
 */

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

/* "pylsewave/cynum.pyx":157
 *     # cdef cyVessel *a
 *     cdef object _vessels
 *     def __cinit__(self, cyVessel vec = None, list vessels=None, DTYPE_t p0=-1, DTYPE_t rho=-1,             # <<<<<<<<<<<<<<
 *                   DTYPE_t Re=-1, DTYPE_t dx=-1, DTYPE_t Nx=-1, DTYPE_t qc=1., DTYPE_t rc=1.):
 *         cdef vector[Vessel] v = vector[Vessel]()
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_vec = 0;
  PyObject *__pyx_v_vessels = 0;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_p0;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rho;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Re;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_dx;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Nx;
  CYTHON_UNUSED __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_qc;
  CYTHON_UNUSED __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rc;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_vessels,&__pyx_n_s_p0,&__pyx_n_s_rho,&__pyx_n_s_Re,&__pyx_n_s_dx,&__pyx_n_s_Nx,&__pyx_n_s_qc,&__pyx_n_s_rc,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    values[0] = (PyObject *)((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)Py_None);
    values[1] = ((PyObject*)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vec);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessels);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p0);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rho);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Re);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Nx);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qc);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rc);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 157, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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;
      }
    }
    __pyx_v_vec = ((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)values[0]);
    __pyx_v_vessels = ((PyObject*)values[1]);
    if (values[2]) {
      __pyx_v_p0 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_p0 == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L3_error)
    } else {
      __pyx_v_p0 = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)-1.0);
    }
    if (values[3]) {
      __pyx_v_rho = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_rho == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L3_error)
    } else {
      __pyx_v_rho = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)-1.0);
    }
    if (values[4]) {
      __pyx_v_Re = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_Re == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error)
    } else {
      __pyx_v_Re = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)-1.0);
    }
    if (values[5]) {
      __pyx_v_dx = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_dx == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error)
    } else {
      __pyx_v_dx = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)-1.0);
    }
    if (values[6]) {
      __pyx_v_Nx = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_Nx == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error)
    } else {
      __pyx_v_Nx = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)-1.0);
    }
    if (values[7]) {
      __pyx_v_qc = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_qc == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error)
    } else {
      __pyx_v_qc = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)1.);
    }
    if (values[8]) {
      __pyx_v_rc = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_rc == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error)
    } else {
      __pyx_v_rc = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)1.);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 157, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_9pylsewave_5cynum_cyVessel, 1, "vec", 0))) __PYX_ERR(0, 157, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vessels), (&PyList_Type), 1, "vessels", 1))) __PYX_ERR(0, 157, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork___cinit__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self), __pyx_v_vec, __pyx_v_vessels, __pyx_v_p0, __pyx_v_rho, __pyx_v_Re, __pyx_v_dx, __pyx_v_Nx, __pyx_v_qc, __pyx_v_rc);

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

static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork___cinit__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_vec, PyObject *__pyx_v_vessels, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_p0, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rho, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Re, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_dx, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Nx, CYTHON_UNUSED __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_qc, CYTHON_UNUSED __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rc) {
  std::vector<Vessel>  __pyx_v_v;
  struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_a = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::vector<Vessel>  __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  VesselNetwork *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pylsewave/cynum.pyx":159
 *     def __cinit__(self, cyVessel vec = None, list vessels=None, DTYPE_t p0=-1, DTYPE_t rho=-1,
 *                   DTYPE_t Re=-1, DTYPE_t dx=-1, DTYPE_t Nx=-1, DTYPE_t qc=1., DTYPE_t rc=1.):
 *         cdef vector[Vessel] v = vector[Vessel]()             # <<<<<<<<<<<<<<
 *         cdef cyVessel a
 *         if type(self) is cyVesselNetwork:
 */
  try {
    __pyx_t_1 = std::vector<Vessel> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 159, __pyx_L1_error)
  }
  __pyx_v_v = __pyx_t_1;

  /* "pylsewave/cynum.pyx":161
 *         cdef vector[Vessel] v = vector[Vessel]()
 *         cdef cyVessel a
 *         if type(self) is cyVesselNetwork:             # <<<<<<<<<<<<<<
 *             if vec is not None and vessels is None:
 *                 self.thisptr = new VesselNetwork(deref(vec.thisptr), p0, rho, Re, dx, Nx)
 */
  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_9pylsewave_5cynum_cyVesselNetwork));
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pylsewave/cynum.pyx":162
 *         cdef cyVessel a
 *         if type(self) is cyVesselNetwork:
 *             if vec is not None and vessels is None:             # <<<<<<<<<<<<<<
 *                 self.thisptr = new VesselNetwork(deref(vec.thisptr), p0, rho, Re, dx, Nx)
 *             if vessels is not None and vec is None:
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_vec) != Py_None);
    __pyx_t_4 = (__pyx_t_2 != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_vessels == ((PyObject*)Py_None));
    __pyx_t_2 = (__pyx_t_4 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_3) {

      /* "pylsewave/cynum.pyx":163
 *         if type(self) is cyVesselNetwork:
 *             if vec is not None and vessels is None:
 *                 self.thisptr = new VesselNetwork(deref(vec.thisptr), p0, rho, Re, dx, Nx)             # <<<<<<<<<<<<<<
 *             if vessels is not None and vec is None:
 *                 self._vessels = vessels
 */
      try {
        __pyx_t_5 = new VesselNetwork((*__pyx_v_vec->thisptr), __pyx_v_p0, __pyx_v_rho, __pyx_v_Re, __pyx_v_dx, __pyx_v_Nx);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 163, __pyx_L1_error)
      }
      __pyx_v_self->thisptr = __pyx_t_5;

      /* "pylsewave/cynum.pyx":162
 *         cdef cyVessel a
 *         if type(self) is cyVesselNetwork:
 *             if vec is not None and vessels is None:             # <<<<<<<<<<<<<<
 *                 self.thisptr = new VesselNetwork(deref(vec.thisptr), p0, rho, Re, dx, Nx)
 *             if vessels is not None and vec is None:
 */
    }

    /* "pylsewave/cynum.pyx":164
 *             if vec is not None and vessels is None:
 *                 self.thisptr = new VesselNetwork(deref(vec.thisptr), p0, rho, Re, dx, Nx)
 *             if vessels is not None and vec is None:             # <<<<<<<<<<<<<<
 *                 self._vessels = vessels
 *                 for a in vessels:
 */
    __pyx_t_2 = (__pyx_v_vessels != ((PyObject*)Py_None));
    __pyx_t_4 = (__pyx_t_2 != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_4 = (((PyObject *)__pyx_v_vec) == Py_None);
    __pyx_t_2 = (__pyx_t_4 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_3) {

      /* "pylsewave/cynum.pyx":165
 *                 self.thisptr = new VesselNetwork(deref(vec.thisptr), p0, rho, Re, dx, Nx)
 *             if vessels is not None and vec is None:
 *                 self._vessels = vessels             # <<<<<<<<<<<<<<
 *                 for a in vessels:
 *                     v.push_back(deref(a.thisptr))
 */
      __Pyx_INCREF(__pyx_v_vessels);
      __Pyx_GIVEREF(__pyx_v_vessels);
      __Pyx_GOTREF(__pyx_v_self->_vessels);
      __Pyx_DECREF(__pyx_v_self->_vessels);
      __pyx_v_self->_vessels = __pyx_v_vessels;

      /* "pylsewave/cynum.pyx":166
 *             if vessels is not None and vec is None:
 *                 self._vessels = vessels
 *                 for a in vessels:             # <<<<<<<<<<<<<<
 *                     v.push_back(deref(a.thisptr))
 *                 self.thisptr = new VesselNetwork(v, p0, rho, Re, dx, Nx)
 */
      if (unlikely(__pyx_v_vessels == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 166, __pyx_L1_error)
      }
      __pyx_t_6 = __pyx_v_vessels; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      for (;;) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 166, __pyx_L1_error)
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
        if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_9pylsewave_5cynum_cyVessel))))) __PYX_ERR(0, 166, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_a, ((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_t_8));
        __pyx_t_8 = 0;

        /* "pylsewave/cynum.pyx":167
 *                 self._vessels = vessels
 *                 for a in vessels:
 *                     v.push_back(deref(a.thisptr))             # <<<<<<<<<<<<<<
 *                 self.thisptr = new VesselNetwork(v, p0, rho, Re, dx, Nx)
 * #                self.thisptr = new VesselNetwork(<vector[Vessel]> args[0], p0, rho, Re, dx, Nx)
 */
        try {
          __pyx_v_v.push_back((*__pyx_v_a->thisptr));
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 167, __pyx_L1_error)
        }

        /* "pylsewave/cynum.pyx":166
 *             if vessels is not None and vec is None:
 *                 self._vessels = vessels
 *                 for a in vessels:             # <<<<<<<<<<<<<<
 *                     v.push_back(deref(a.thisptr))
 *                 self.thisptr = new VesselNetwork(v, p0, rho, Re, dx, Nx)
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pylsewave/cynum.pyx":168
 *                 for a in vessels:
 *                     v.push_back(deref(a.thisptr))
 *                 self.thisptr = new VesselNetwork(v, p0, rho, Re, dx, Nx)             # <<<<<<<<<<<<<<
 * #                self.thisptr = new VesselNetwork(<vector[Vessel]> args[0], p0, rho, Re, dx, Nx)
 * 
 */
      try {
        __pyx_t_5 = new VesselNetwork(__pyx_v_v, __pyx_v_p0, __pyx_v_rho, __pyx_v_Re, __pyx_v_dx, __pyx_v_Nx);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 168, __pyx_L1_error)
      }
      __pyx_v_self->thisptr = __pyx_t_5;

      /* "pylsewave/cynum.pyx":164
 *             if vec is not None and vessels is None:
 *                 self.thisptr = new VesselNetwork(deref(vec.thisptr), p0, rho, Re, dx, Nx)
 *             if vessels is not None and vec is None:             # <<<<<<<<<<<<<<
 *                 self._vessels = vessels
 *                 for a in vessels:
 */
    }

    /* "pylsewave/cynum.pyx":161
 *         cdef vector[Vessel] v = vector[Vessel]()
 *         cdef cyVessel a
 *         if type(self) is cyVesselNetwork:             # <<<<<<<<<<<<<<
 *             if vec is not None and vessels is None:
 *                 self.thisptr = new VesselNetwork(deref(vec.thisptr), p0, rho, Re, dx, Nx)
 */
  }

  /* "pylsewave/cynum.pyx":157
 *     # cdef cyVessel *a
 *     cdef object _vessels
 *     def __cinit__(self, cyVessel vec = None, list vessels=None, DTYPE_t p0=-1, DTYPE_t rho=-1,             # <<<<<<<<<<<<<<
 *                   DTYPE_t Re=-1, DTYPE_t dx=-1, DTYPE_t Nx=-1, DTYPE_t qc=1., DTYPE_t rc=1.):
 *         cdef vector[Vessel] v = vector[Vessel]()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_a);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":175
 * 
 *     @property
 *     def vessels(self):             # <<<<<<<<<<<<<<
 *         return self._vessels
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_7vessels_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_7vessels_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_7vessels___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_7vessels___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":176
 *     @property
 *     def vessels(self):
 *         return self._vessels             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_vessels);
  __pyx_r = __pyx_v_self->_vessels;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":175
 * 
 *     @property
 *     def vessels(self):             # <<<<<<<<<<<<<<
 *         return self._vessels
 * 
 */

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

/* "pylsewave/cynum.pyx":179
 * 
 *     @property
 *     def dx(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get_dx()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2dx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2dx_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2dx___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2dx___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":180
 *     @property
 *     def dx(self):
 *         return self.thisptr.get_dx()             # <<<<<<<<<<<<<<
 * 
 *     @dx.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->get_dx()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":179
 * 
 *     @property
 *     def dx(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get_dx()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.dx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":183
 * 
 *     @dx.setter
 *     def dx(self, indx):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_dx(indx)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2dx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_indx); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2dx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_indx) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2dx_2__set__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self), ((PyObject *)__pyx_v_indx));

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

static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2dx_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, PyObject *__pyx_v_indx) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pylsewave/cynum.pyx":184
 *     @dx.setter
 *     def dx(self, indx):
 *         self.thisptr.set_dx(indx)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_indx); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
  __pyx_v_self->thisptr->set_dx(__pyx_t_1);

  /* "pylsewave/cynum.pyx":183
 * 
 *     @dx.setter
 *     def dx(self, indx):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_dx(indx)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.dx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":187
 * 
 *     @property
 *     def p0(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get_p0()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2p0_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2p0_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2p0___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2p0___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":188
 *     @property
 *     def p0(self):
 *         return self.thisptr.get_p0()             # <<<<<<<<<<<<<<
 * 
 *     @p0.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->get_p0()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":187
 * 
 *     @property
 *     def p0(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get_p0()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.p0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":191
 * 
 *     @p0.setter
 *     def p0(self, inp0):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_p0(inp0)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2p0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inp0); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2p0_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inp0) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2p0_2__set__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self), ((PyObject *)__pyx_v_inp0));

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

static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2p0_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, PyObject *__pyx_v_inp0) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pylsewave/cynum.pyx":192
 *     @p0.setter
 *     def p0(self, inp0):
 *         self.thisptr.set_p0(inp0)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_inp0); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L1_error)
  __pyx_v_self->thisptr->set_p0(__pyx_t_1);

  /* "pylsewave/cynum.pyx":191
 * 
 *     @p0.setter
 *     def p0(self, inp0):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_p0(inp0)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.p0.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":195
 * 
 *     @property
 *     def Re(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get_Re()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2Re_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2Re_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2Re___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2Re___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":196
 *     @property
 *     def Re(self):
 *         return self.thisptr.get_Re()             # <<<<<<<<<<<<<<
 * 
 *     @Re.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->get_Re()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":195
 * 
 *     @property
 *     def Re(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get_Re()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.Re.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":199
 * 
 *     @Re.setter
 *     def Re(self, inRe):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_Re(inRe)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2Re_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inRe); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2Re_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inRe) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2Re_2__set__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self), ((PyObject *)__pyx_v_inRe));

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

static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2Re_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, PyObject *__pyx_v_inRe) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pylsewave/cynum.pyx":200
 *     @Re.setter
 *     def Re(self, inRe):
 *         self.thisptr.set_Re(inRe)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_inRe); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error)
  __pyx_v_self->thisptr->set_Re(__pyx_t_1);

  /* "pylsewave/cynum.pyx":199
 * 
 *     @Re.setter
 *     def Re(self, inRe):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_Re(inRe)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.Re.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":203
 * 
 *     @property
 *     def rho(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get_rho()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_3rho_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_3rho_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_3rho___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_3rho___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":204
 *     @property
 *     def rho(self):
 *         return self.thisptr.get_rho()             # <<<<<<<<<<<<<<
 * 
 *     @rho.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->get_rho()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":203
 * 
 *     @property
 *     def rho(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get_rho()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.rho.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":207
 * 
 *     @rho.setter
 *     def rho(self, inrho):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_rho(inrho)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_3rho_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inrho); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_3rho_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inrho) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_3rho_2__set__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self), ((PyObject *)__pyx_v_inrho));

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

static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_3rho_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, PyObject *__pyx_v_inrho) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pylsewave/cynum.pyx":208
 *     @rho.setter
 *     def rho(self, inrho):
 *         self.thisptr.set_rho(inrho)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_inrho); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L1_error)
  __pyx_v_self->thisptr->set_rho(__pyx_t_1);

  /* "pylsewave/cynum.pyx":207
 * 
 *     @rho.setter
 *     def rho(self, inrho):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_rho(inrho)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.rho.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":211
 * 
 *     @property
 *     def delta(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get_delta()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_5delta_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_5delta_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_5delta___get__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_5delta___get__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":212
 *     @property
 *     def delta(self):
 *         return self.thisptr.get_delta()             # <<<<<<<<<<<<<<
 * 
 *     @delta.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->get_delta()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":211
 * 
 *     @property
 *     def delta(self):             # <<<<<<<<<<<<<<
 *         return self.thisptr.get_delta()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.delta.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":215
 * 
 *     @delta.setter
 *     def delta(self, indelta):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_delta(indelta)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_5delta_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_indelta); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_5delta_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_indelta) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_5delta_2__set__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self), ((PyObject *)__pyx_v_indelta));

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

static int __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_5delta_2__set__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self, PyObject *__pyx_v_indelta) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pylsewave/cynum.pyx":216
 *     @delta.setter
 *     def delta(self, indelta):
 *         self.thisptr.set_delta(indelta)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_indelta); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error)
  __pyx_v_self->thisptr->set_delta(__pyx_t_1);

  /* "pylsewave/cynum.pyx":215
 * 
 *     @delta.setter
 *     def delta(self, indelta):             # <<<<<<<<<<<<<<
 *         self.thisptr.set_delta(indelta)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetwork.delta.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":218
 *         self.thisptr.set_delta(indelta)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is cyVesselNetwork:
 *             del self.thisptr
 */

/* Python wrapper */
static void __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2__dealloc__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)__pyx_v_self));

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

static void __pyx_pf_9pylsewave_5cynum_15cyVesselNetwork_2__dealloc__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pylsewave/cynum.pyx":219
 * 
 *     def __dealloc__(self):
 *         if type(self) is cyVesselNetwork:             # <<<<<<<<<<<<<<
 *             del self.thisptr
 * 
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_9pylsewave_5cynum_cyVesselNetwork));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pylsewave/cynum.pyx":220
 *     def __dealloc__(self):
 *         if type(self) is cyVesselNetwork:
 *             del self.thisptr             # <<<<<<<<<<<<<<
 * 
 * cdef class cyVesselNetworkSc(cyVesselNetwork):
 */
    delete __pyx_v_self->thisptr;

    /* "pylsewave/cynum.pyx":219
 * 
 *     def __dealloc__(self):
 *         if type(self) is cyVesselNetwork:             # <<<<<<<<<<<<<<
 *             del self.thisptr
 * 
 */
  }

  /* "pylsewave/cynum.pyx":218
 *         self.thisptr.set_delta(indelta)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is cyVesselNetwork:
 *             del self.thisptr
 */

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

/* "pylsewave/cynum.pyx":224
 * cdef class cyVesselNetworkSc(cyVesselNetwork):
 *     cdef VesselNetworkSc *thisptrDerived
 *     def __cinit__(self, cyVessel vec = None, list vessels=None, DTYPE_t p0=-1, DTYPE_t rho=-1,             # <<<<<<<<<<<<<<
 *                  DTYPE_t Re=-1, DTYPE_t dx=-1, DTYPE_t Nx=-1, DTYPE_t qc=1., DTYPE_t rc=1.):
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_17cyVesselNetworkSc_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_17cyVesselNetworkSc_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_vec = 0;
  PyObject *__pyx_v_vessels = 0;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_p0;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rho;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Re;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_dx;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Nx;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_qc;
  __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rc;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_vessels,&__pyx_n_s_p0,&__pyx_n_s_rho,&__pyx_n_s_Re,&__pyx_n_s_dx,&__pyx_n_s_Nx,&__pyx_n_s_qc,&__pyx_n_s_rc,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    values[0] = (PyObject *)((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)Py_None);
    values[1] = ((PyObject*)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vec);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessels);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p0);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rho);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Re);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Nx);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_qc);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rc);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 224, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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;
      }
    }
    __pyx_v_vec = ((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)values[0]);
    __pyx_v_vessels = ((PyObject*)values[1]);
    if (values[2]) {
      __pyx_v_p0 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_p0 == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error)
    } else {
      __pyx_v_p0 = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)-1.0);
    }
    if (values[3]) {
      __pyx_v_rho = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_rho == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L3_error)
    } else {
      __pyx_v_rho = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)-1.0);
    }
    if (values[4]) {
      __pyx_v_Re = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_Re == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
    } else {
      __pyx_v_Re = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)-1.0);
    }
    if (values[5]) {
      __pyx_v_dx = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_dx == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
    } else {
      __pyx_v_dx = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)-1.0);
    }
    if (values[6]) {
      __pyx_v_Nx = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_Nx == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
    } else {
      __pyx_v_Nx = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)-1.0);
    }
    if (values[7]) {
      __pyx_v_qc = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_qc == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
    } else {
      __pyx_v_qc = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)1.);
    }
    if (values[8]) {
      __pyx_v_rc = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_rc == (npy_double)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
    } else {
      __pyx_v_rc = ((__pyx_t_9pylsewave_5cynum_DTYPE_t)1.);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetworkSc.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_9pylsewave_5cynum_cyVessel, 1, "vec", 0))) __PYX_ERR(0, 224, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vessels), (&PyList_Type), 1, "vessels", 1))) __PYX_ERR(0, 224, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pylsewave_5cynum_17cyVesselNetworkSc___cinit__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc *)__pyx_v_self), __pyx_v_vec, __pyx_v_vessels, __pyx_v_p0, __pyx_v_rho, __pyx_v_Re, __pyx_v_dx, __pyx_v_Nx, __pyx_v_qc, __pyx_v_rc);

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

static int __pyx_pf_9pylsewave_5cynum_17cyVesselNetworkSc___cinit__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc *__pyx_v_self, struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_vec, PyObject *__pyx_v_vessels, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_p0, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rho, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Re, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_dx, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_Nx, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_qc, __pyx_t_9pylsewave_5cynum_DTYPE_t __pyx_v_rc) {
  std::vector<Vessel>  __pyx_v_v;
  struct __pyx_obj_9pylsewave_5cynum_cyVessel *__pyx_v_a = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::vector<Vessel>  __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  VesselNetworkSc *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pylsewave/cynum.pyx":227
 *                  DTYPE_t Re=-1, DTYPE_t dx=-1, DTYPE_t Nx=-1, DTYPE_t qc=1., DTYPE_t rc=1.):
 * 
 *         cdef vector[Vessel] v = vector[Vessel]()             # <<<<<<<<<<<<<<
 *         cdef cyVessel a
 *         if type(self) is cyVesselNetworkSc:
 */
  try {
    __pyx_t_1 = std::vector<Vessel> ();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 227, __pyx_L1_error)
  }
  __pyx_v_v = __pyx_t_1;

  /* "pylsewave/cynum.pyx":229
 *         cdef vector[Vessel] v = vector[Vessel]()
 *         cdef cyVessel a
 *         if type(self) is cyVesselNetworkSc:             # <<<<<<<<<<<<<<
 *             if vec is not None and vessels is None:
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(deref(vec.thisptr), p0, rho, Re, dx, Nx,
 */
  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_9pylsewave_5cynum_cyVesselNetworkSc));
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pylsewave/cynum.pyx":230
 *         cdef cyVessel a
 *         if type(self) is cyVesselNetworkSc:
 *             if vec is not None and vessels is None:             # <<<<<<<<<<<<<<
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(deref(vec.thisptr), p0, rho, Re, dx, Nx,
 *                                                                          qc, rc)
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_vec) != Py_None);
    __pyx_t_4 = (__pyx_t_2 != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_vessels == ((PyObject*)Py_None));
    __pyx_t_2 = (__pyx_t_4 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_3) {

      /* "pylsewave/cynum.pyx":231
 *         if type(self) is cyVesselNetworkSc:
 *             if vec is not None and vessels is None:
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(deref(vec.thisptr), p0, rho, Re, dx, Nx,             # <<<<<<<<<<<<<<
 *                                                                          qc, rc)
 *             if vessels is not None and vec is None:
 */
      try {
        __pyx_t_5 = new VesselNetworkSc((*__pyx_v_vec->thisptr), __pyx_v_p0, __pyx_v_rho, __pyx_v_Re, __pyx_v_dx, __pyx_v_Nx, __pyx_v_qc, __pyx_v_rc);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 231, __pyx_L1_error)
      }
      __pyx_v_self->thisptrDerived = __pyx_t_5;
      __pyx_v_self->__pyx_base.thisptr = __pyx_t_5;

      /* "pylsewave/cynum.pyx":230
 *         cdef cyVessel a
 *         if type(self) is cyVesselNetworkSc:
 *             if vec is not None and vessels is None:             # <<<<<<<<<<<<<<
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(deref(vec.thisptr), p0, rho, Re, dx, Nx,
 *                                                                          qc, rc)
 */
    }

    /* "pylsewave/cynum.pyx":233
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(deref(vec.thisptr), p0, rho, Re, dx, Nx,
 *                                                                          qc, rc)
 *             if vessels is not None and vec is None:             # <<<<<<<<<<<<<<
 *                 self._vessels = vessels
 *                 for a in vessels:
 */
    __pyx_t_2 = (__pyx_v_vessels != ((PyObject*)Py_None));
    __pyx_t_4 = (__pyx_t_2 != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_4 = (((PyObject *)__pyx_v_vec) == Py_None);
    __pyx_t_2 = (__pyx_t_4 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_3) {

      /* "pylsewave/cynum.pyx":234
 *                                                                          qc, rc)
 *             if vessels is not None and vec is None:
 *                 self._vessels = vessels             # <<<<<<<<<<<<<<
 *                 for a in vessels:
 *                     v.push_back(deref(a.thisptr))
 */
      __Pyx_INCREF(__pyx_v_vessels);
      __Pyx_GIVEREF(__pyx_v_vessels);
      __Pyx_GOTREF(__pyx_v_self->__pyx_base._vessels);
      __Pyx_DECREF(__pyx_v_self->__pyx_base._vessels);
      __pyx_v_self->__pyx_base._vessels = __pyx_v_vessels;

      /* "pylsewave/cynum.pyx":235
 *             if vessels is not None and vec is None:
 *                 self._vessels = vessels
 *                 for a in vessels:             # <<<<<<<<<<<<<<
 *                     v.push_back(deref(a.thisptr))
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(v, p0, rho, Re, dx, Nx, qc, rc)
 */
      if (unlikely(__pyx_v_vessels == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 235, __pyx_L1_error)
      }
      __pyx_t_6 = __pyx_v_vessels; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      for (;;) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
        if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_9pylsewave_5cynum_cyVessel))))) __PYX_ERR(0, 235, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_a, ((struct __pyx_obj_9pylsewave_5cynum_cyVessel *)__pyx_t_8));
        __pyx_t_8 = 0;

        /* "pylsewave/cynum.pyx":236
 *                 self._vessels = vessels
 *                 for a in vessels:
 *                     v.push_back(deref(a.thisptr))             # <<<<<<<<<<<<<<
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(v, p0, rho, Re, dx, Nx, qc, rc)
 * 
 */
        try {
          __pyx_v_v.push_back((*__pyx_v_a->thisptr));
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 236, __pyx_L1_error)
        }

        /* "pylsewave/cynum.pyx":235
 *             if vessels is not None and vec is None:
 *                 self._vessels = vessels
 *                 for a in vessels:             # <<<<<<<<<<<<<<
 *                     v.push_back(deref(a.thisptr))
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(v, p0, rho, Re, dx, Nx, qc, rc)
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pylsewave/cynum.pyx":237
 *                 for a in vessels:
 *                     v.push_back(deref(a.thisptr))
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(v, p0, rho, Re, dx, Nx, qc, rc)             # <<<<<<<<<<<<<<
 * 
 *     def set_boundary_layer_th(self, T, no_cycles):
 */
      try {
        __pyx_t_5 = new VesselNetworkSc(__pyx_v_v, __pyx_v_p0, __pyx_v_rho, __pyx_v_Re, __pyx_v_dx, __pyx_v_Nx, __pyx_v_qc, __pyx_v_rc);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 237, __pyx_L1_error)
      }
      __pyx_v_self->thisptrDerived = __pyx_t_5;
      __pyx_v_self->__pyx_base.thisptr = __pyx_t_5;

      /* "pylsewave/cynum.pyx":233
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(deref(vec.thisptr), p0, rho, Re, dx, Nx,
 *                                                                          qc, rc)
 *             if vessels is not None and vec is None:             # <<<<<<<<<<<<<<
 *                 self._vessels = vessels
 *                 for a in vessels:
 */
    }

    /* "pylsewave/cynum.pyx":229
 *         cdef vector[Vessel] v = vector[Vessel]()
 *         cdef cyVessel a
 *         if type(self) is cyVesselNetworkSc:             # <<<<<<<<<<<<<<
 *             if vec is not None and vessels is None:
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(deref(vec.thisptr), p0, rho, Re, dx, Nx,
 */
  }

  /* "pylsewave/cynum.pyx":224
 * cdef class cyVesselNetworkSc(cyVesselNetwork):
 *     cdef VesselNetworkSc *thisptrDerived
 *     def __cinit__(self, cyVessel vec = None, list vessels=None, DTYPE_t p0=-1, DTYPE_t rho=-1,             # <<<<<<<<<<<<<<
 *                  DTYPE_t Re=-1, DTYPE_t dx=-1, DTYPE_t Nx=-1, DTYPE_t qc=1., DTYPE_t rc=1.):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetworkSc.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_a);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":239
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(v, p0, rho, Re, dx, Nx, qc, rc)
 * 
 *     def set_boundary_layer_th(self, T, no_cycles):             # <<<<<<<<<<<<<<
 *         self.thisptrDerived.set_boundary_layer_th(T, no_cycles)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_17cyVesselNetworkSc_3set_boundary_layer_th(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_17cyVesselNetworkSc_3set_boundary_layer_th(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_T = 0;
  PyObject *__pyx_v_no_cycles = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_boundary_layer_th (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_T,&__pyx_n_s_no_cycles,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_T)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_no_cycles)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_boundary_layer_th", 1, 2, 2, 1); __PYX_ERR(0, 239, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_boundary_layer_th") < 0)) __PYX_ERR(0, 239, __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_T = values[0];
    __pyx_v_no_cycles = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_boundary_layer_th", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 239, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetworkSc.set_boundary_layer_th", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_17cyVesselNetworkSc_2set_boundary_layer_th(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc *)__pyx_v_self), __pyx_v_T, __pyx_v_no_cycles);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_17cyVesselNetworkSc_2set_boundary_layer_th(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc *__pyx_v_self, PyObject *__pyx_v_T, PyObject *__pyx_v_no_cycles) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_boundary_layer_th", 0);

  /* "pylsewave/cynum.pyx":240
 * 
 *     def set_boundary_layer_th(self, T, no_cycles):
 *         self.thisptrDerived.set_boundary_layer_th(T, no_cycles)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_T); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_no_cycles); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
  __pyx_v_self->thisptrDerived->set_boundary_layer_th(__pyx_t_1, __pyx_t_2);

  /* "pylsewave/cynum.pyx":239
 *                 self.thisptrDerived = self.thisptr = new VesselNetworkSc(v, p0, rho, Re, dx, Nx, qc, rc)
 * 
 *     def set_boundary_layer_th(self, T, no_cycles):             # <<<<<<<<<<<<<<
 *         self.thisptrDerived.set_boundary_layer_th(T, no_cycles)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cyVesselNetworkSc.set_boundary_layer_th", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":242
 *         self.thisptrDerived.set_boundary_layer_th(T, no_cycles)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is cyVesselNetworkSc:
 *             del self.thisptrDerived
 */

/* Python wrapper */
static void __pyx_pw_9pylsewave_5cynum_17cyVesselNetworkSc_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_9pylsewave_5cynum_17cyVesselNetworkSc_5__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_9pylsewave_5cynum_17cyVesselNetworkSc_4__dealloc__(((struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc *)__pyx_v_self));

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

static void __pyx_pf_9pylsewave_5cynum_17cyVesselNetworkSc_4__dealloc__(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pylsewave/cynum.pyx":243
 * 
 *     def __dealloc__(self):
 *         if type(self) is cyVesselNetworkSc:             # <<<<<<<<<<<<<<
 *             del self.thisptrDerived
 * 
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_9pylsewave_5cynum_cyVesselNetworkSc));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pylsewave/cynum.pyx":244
 *     def __dealloc__(self):
 *         if type(self) is cyVesselNetworkSc:
 *             del self.thisptrDerived             # <<<<<<<<<<<<<<
 * 
 * 
 */
    delete __pyx_v_self->thisptrDerived;

    /* "pylsewave/cynum.pyx":243
 * 
 *     def __dealloc__(self):
 *         if type(self) is cyVesselNetworkSc:             # <<<<<<<<<<<<<<
 *             del self.thisptrDerived
 * 
 */
  }

  /* "pylsewave/cynum.pyx":242
 *         self.thisptrDerived.set_boundary_layer_th(T, no_cycles)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is cyVesselNetworkSc:
 *             del self.thisptrDerived
 */

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

/* "pylsewave/cynum.pyx":247
 * 
 * 
 * cpdef double pystd_dev(np.ndarray[np.float64_t, ndim=1] a):             # <<<<<<<<<<<<<<
 *     return std_dev(<double*> a.data, a.size)
 * 
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_1pystd_dev(PyObject *__pyx_self, PyObject *__pyx_v_a); /*proto*/
static double __pyx_f_9pylsewave_5cynum_pystd_dev(PyArrayObject *__pyx_v_a, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
  __Pyx_Buffer __pyx_pybuffer_a;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  __Pyx_RefNannySetupContext("pystd_dev", 0);
  __pyx_pybuffer_a.pybuffer.buf = NULL;
  __pyx_pybuffer_a.refcount = 0;
  __pyx_pybuffernd_a.data = NULL;
  __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 247, __pyx_L1_error)
  }
  __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0];

  /* "pylsewave/cynum.pyx":248
 * 
 * cpdef double pystd_dev(np.ndarray[np.float64_t, ndim=1] a):
 *     return std_dev(<double*> a.data, a.size)             # <<<<<<<<<<<<<<
 * 
 * cpdef int pytdma(np.ndarray[np.float64_t, ndim=1] a,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = funs::std_dev(((double *)__pyx_v_a->data), __pyx_t_2);
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":247
 * 
 * 
 * cpdef double pystd_dev(np.ndarray[np.float64_t, ndim=1] a):             # <<<<<<<<<<<<<<
 *     return std_dev(<double*> a.data, a.size)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_WriteUnraisable("pylsewave.cynum.pystd_dev", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_1pystd_dev(PyObject *__pyx_self, PyObject *__pyx_v_a); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_1pystd_dev(PyObject *__pyx_self, PyObject *__pyx_v_a) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pystd_dev (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 247, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pylsewave_5cynum_pystd_dev(__pyx_self, ((PyArrayObject *)__pyx_v_a));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_pystd_dev(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
  __Pyx_Buffer __pyx_pybuffer_a;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pystd_dev", 0);
  __pyx_pybuffer_a.pybuffer.buf = NULL;
  __pyx_pybuffer_a.refcount = 0;
  __pyx_pybuffernd_a.data = NULL;
  __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 247, __pyx_L1_error)
  }
  __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_9pylsewave_5cynum_pystd_dev(__pyx_v_a, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __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_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pylsewave.cynum.pystd_dev", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":250
 *     return std_dev(<double*> a.data, a.size)
 * 
 * cpdef int pytdma(np.ndarray[np.float64_t, ndim=1] a,             # <<<<<<<<<<<<<<
 *            np.ndarray[np.float64_t, ndim=1] b,
 *            np.ndarray[np.float64_t, ndim=1] c,
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_3pytdma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9pylsewave_5cynum_pytdma(PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_b, PyArrayObject *__pyx_v_c, PyArrayObject *__pyx_v_d, PyArrayObject *__pyx_v_out, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_siz;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
  __Pyx_Buffer __pyx_pybuffer_a;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_b;
  __Pyx_Buffer __pyx_pybuffer_b;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_c;
  __Pyx_Buffer __pyx_pybuffer_c;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_d;
  __Pyx_Buffer __pyx_pybuffer_d;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pytdma", 0);
  __pyx_pybuffer_a.pybuffer.buf = NULL;
  __pyx_pybuffer_a.refcount = 0;
  __pyx_pybuffernd_a.data = NULL;
  __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
  __pyx_pybuffer_b.pybuffer.buf = NULL;
  __pyx_pybuffer_b.refcount = 0;
  __pyx_pybuffernd_b.data = NULL;
  __pyx_pybuffernd_b.rcbuffer = &__pyx_pybuffer_b;
  __pyx_pybuffer_c.pybuffer.buf = NULL;
  __pyx_pybuffer_c.refcount = 0;
  __pyx_pybuffernd_c.data = NULL;
  __pyx_pybuffernd_c.rcbuffer = &__pyx_pybuffer_c;
  __pyx_pybuffer_d.pybuffer.buf = NULL;
  __pyx_pybuffer_d.refcount = 0;
  __pyx_pybuffernd_d.data = NULL;
  __pyx_pybuffernd_d.rcbuffer = &__pyx_pybuffer_d;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_b.rcbuffer->pybuffer, (PyObject*)__pyx_v_b, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __pyx_pybuffernd_b.diminfo[0].strides = __pyx_pybuffernd_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_b.diminfo[0].shape = __pyx_pybuffernd_b.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c.rcbuffer->pybuffer, (PyObject*)__pyx_v_c, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __pyx_pybuffernd_c.diminfo[0].strides = __pyx_pybuffernd_c.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c.diminfo[0].shape = __pyx_pybuffernd_c.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d.rcbuffer->pybuffer, (PyObject*)__pyx_v_d, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __pyx_pybuffernd_d.diminfo[0].strides = __pyx_pybuffernd_d.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_d.diminfo[0].shape = __pyx_pybuffernd_d.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    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, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __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];

  /* "pylsewave/cynum.pyx":256
 *            np.ndarray[np.float64_t, ndim=1] out):
 * 
 *     cdef Py_ssize_t siz = d.shape[0]             # <<<<<<<<<<<<<<
 * #    cdef np.ndarray[np.float64_t, ndim=1] out = np.zeros(siz, np.float)
 *     return tdma(<double*> a.data, <double*> b.data, <double*> c.data,
 */
  __pyx_v_siz = (__pyx_v_d->dimensions[0]);

  /* "pylsewave/cynum.pyx":258
 *     cdef Py_ssize_t siz = d.shape[0]
 * #    cdef np.ndarray[np.float64_t, ndim=1] out = np.zeros(siz, np.float)
 *     return tdma(<double*> a.data, <double*> b.data, <double*> c.data,             # <<<<<<<<<<<<<<
 *                 <double*> d.data, <double*> out.data, siz)
 * 
 */
  __pyx_r = funs::tdma(((double *)__pyx_v_a->data), ((double *)__pyx_v_b->data), ((double *)__pyx_v_c->data), ((double *)__pyx_v_d->data), ((double *)__pyx_v_out->data), __pyx_v_siz);
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":250
 *     return std_dev(<double*> a.data, a.size)
 * 
 * cpdef int pytdma(np.ndarray[np.float64_t, ndim=1] a,             # <<<<<<<<<<<<<<
 *            np.ndarray[np.float64_t, ndim=1] b,
 *            np.ndarray[np.float64_t, ndim=1] c,
 */

  /* function exit code */
  __pyx_L1_error:;
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_b.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_WriteUnraisable("pylsewave.cynum.pytdma", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_b.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_3pytdma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_3pytdma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_a = 0;
  PyArrayObject *__pyx_v_b = 0;
  PyArrayObject *__pyx_v_c = 0;
  PyArrayObject *__pyx_v_d = 0;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pytdma (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_c,&__pyx_n_s_d,&__pyx_n_s_out,0};
    PyObject* values[5] = {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  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_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pytdma", 1, 5, 5, 1); __PYX_ERR(0, 250, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pytdma", 1, 5, 5, 2); __PYX_ERR(0, 250, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pytdma", 1, 5, 5, 3); __PYX_ERR(0, 250, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pytdma", 1, 5, 5, 4); __PYX_ERR(0, 250, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pytdma") < 0)) __PYX_ERR(0, 250, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
    }
    __pyx_v_a = ((PyArrayObject *)values[0]);
    __pyx_v_b = ((PyArrayObject *)values[1]);
    __pyx_v_c = ((PyArrayObject *)values[2]);
    __pyx_v_d = ((PyArrayObject *)values[3]);
    __pyx_v_out = ((PyArrayObject *)values[4]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pytdma", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 250, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.pytdma", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 250, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_5numpy_ndarray, 1, "b", 0))) __PYX_ERR(0, 251, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_5numpy_ndarray, 1, "c", 0))) __PYX_ERR(0, 252, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_d), __pyx_ptype_5numpy_ndarray, 1, "d", 0))) __PYX_ERR(0, 253, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 254, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pylsewave_5cynum_2pytdma(__pyx_self, __pyx_v_a, __pyx_v_b, __pyx_v_c, __pyx_v_d, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_2pytdma(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, PyArrayObject *__pyx_v_b, PyArrayObject *__pyx_v_c, PyArrayObject *__pyx_v_d, PyArrayObject *__pyx_v_out) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
  __Pyx_Buffer __pyx_pybuffer_a;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_b;
  __Pyx_Buffer __pyx_pybuffer_b;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_c;
  __Pyx_Buffer __pyx_pybuffer_c;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_d;
  __Pyx_Buffer __pyx_pybuffer_d;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pytdma", 0);
  __pyx_pybuffer_a.pybuffer.buf = NULL;
  __pyx_pybuffer_a.refcount = 0;
  __pyx_pybuffernd_a.data = NULL;
  __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
  __pyx_pybuffer_b.pybuffer.buf = NULL;
  __pyx_pybuffer_b.refcount = 0;
  __pyx_pybuffernd_b.data = NULL;
  __pyx_pybuffernd_b.rcbuffer = &__pyx_pybuffer_b;
  __pyx_pybuffer_c.pybuffer.buf = NULL;
  __pyx_pybuffer_c.refcount = 0;
  __pyx_pybuffernd_c.data = NULL;
  __pyx_pybuffernd_c.rcbuffer = &__pyx_pybuffer_c;
  __pyx_pybuffer_d.pybuffer.buf = NULL;
  __pyx_pybuffer_d.refcount = 0;
  __pyx_pybuffernd_d.data = NULL;
  __pyx_pybuffernd_d.rcbuffer = &__pyx_pybuffer_d;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_b.rcbuffer->pybuffer, (PyObject*)__pyx_v_b, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __pyx_pybuffernd_b.diminfo[0].strides = __pyx_pybuffernd_b.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_b.diminfo[0].shape = __pyx_pybuffernd_b.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_c.rcbuffer->pybuffer, (PyObject*)__pyx_v_c, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __pyx_pybuffernd_c.diminfo[0].strides = __pyx_pybuffernd_c.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c.diminfo[0].shape = __pyx_pybuffernd_c.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d.rcbuffer->pybuffer, (PyObject*)__pyx_v_d, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __pyx_pybuffernd_d.diminfo[0].strides = __pyx_pybuffernd_d.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_d.diminfo[0].shape = __pyx_pybuffernd_d.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    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, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 250, __pyx_L1_error)
  }
  __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];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_9pylsewave_5cynum_pytdma(__pyx_v_a, __pyx_v_b, __pyx_v_c, __pyx_v_d, __pyx_v_out, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __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_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_b.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pylsewave.cynum.pytdma", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_b.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":262
 * 
 * 
 * cpdef int cpwgrad(np.ndarray[np.float64_t, ndim=1] inarr, np.ndarray[np.float64_t, ndim=1] out,             # <<<<<<<<<<<<<<
 *                   double dx):
 *     cdef Py_ssize_t siz = inarr.shape[0]
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_5cpwgrad(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9pylsewave_5cynum_cpwgrad(PyArrayObject *__pyx_v_inarr, PyArrayObject *__pyx_v_out, double __pyx_v_dx, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_siz;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_inarr;
  __Pyx_Buffer __pyx_pybuffer_inarr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cpwgrad", 0);
  __pyx_pybuffer_inarr.pybuffer.buf = NULL;
  __pyx_pybuffer_inarr.refcount = 0;
  __pyx_pybuffernd_inarr.data = NULL;
  __pyx_pybuffernd_inarr.rcbuffer = &__pyx_pybuffer_inarr;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_inarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 262, __pyx_L1_error)
  }
  __pyx_pybuffernd_inarr.diminfo[0].strides = __pyx_pybuffernd_inarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inarr.diminfo[0].shape = __pyx_pybuffernd_inarr.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    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, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 262, __pyx_L1_error)
  }
  __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];

  /* "pylsewave/cynum.pyx":264
 * cpdef int cpwgrad(np.ndarray[np.float64_t, ndim=1] inarr, np.ndarray[np.float64_t, ndim=1] out,
 *                   double dx):
 *     cdef Py_ssize_t siz = inarr.shape[0]             # <<<<<<<<<<<<<<
 *     return grad(<double*> inarr.data, <double*> out.data, dx, siz)
 * 
 */
  __pyx_v_siz = (__pyx_v_inarr->dimensions[0]);

  /* "pylsewave/cynum.pyx":265
 *                   double dx):
 *     cdef Py_ssize_t siz = inarr.shape[0]
 *     return grad(<double*> inarr.data, <double*> out.data, dx, siz)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = funs::grad(((double *)__pyx_v_inarr->data), ((double *)__pyx_v_out->data), __pyx_v_dx, __pyx_v_siz);
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":262
 * 
 * 
 * cpdef int cpwgrad(np.ndarray[np.float64_t, ndim=1] inarr, np.ndarray[np.float64_t, ndim=1] out,             # <<<<<<<<<<<<<<
 *                   double dx):
 *     cdef Py_ssize_t siz = inarr.shape[0]
 */

  /* function exit code */
  __pyx_L1_error:;
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inarr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_WriteUnraisable("pylsewave.cynum.cpwgrad", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inarr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_5cpwgrad(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_5cpwgrad(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_inarr = 0;
  PyArrayObject *__pyx_v_out = 0;
  double __pyx_v_dx;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cpwgrad (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inarr,&__pyx_n_s_out,&__pyx_n_s_dx,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_inarr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cpwgrad", 1, 3, 3, 1); __PYX_ERR(0, 262, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cpwgrad", 1, 3, 3, 2); __PYX_ERR(0, 262, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cpwgrad") < 0)) __PYX_ERR(0, 262, __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_inarr = ((PyArrayObject *)values[0]);
    __pyx_v_out = ((PyArrayObject *)values[1]);
    __pyx_v_dx = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 263, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cpwgrad", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 262, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cpwgrad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inarr), __pyx_ptype_5numpy_ndarray, 1, "inarr", 0))) __PYX_ERR(0, 262, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 262, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pylsewave_5cynum_4cpwgrad(__pyx_self, __pyx_v_inarr, __pyx_v_out, __pyx_v_dx);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_4cpwgrad(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_inarr, PyArrayObject *__pyx_v_out, double __pyx_v_dx) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_inarr;
  __Pyx_Buffer __pyx_pybuffer_inarr;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("cpwgrad", 0);
  __pyx_pybuffer_inarr.pybuffer.buf = NULL;
  __pyx_pybuffer_inarr.refcount = 0;
  __pyx_pybuffernd_inarr.data = NULL;
  __pyx_pybuffernd_inarr.rcbuffer = &__pyx_pybuffer_inarr;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_inarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 262, __pyx_L1_error)
  }
  __pyx_pybuffernd_inarr.diminfo[0].strides = __pyx_pybuffernd_inarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inarr.diminfo[0].shape = __pyx_pybuffernd_inarr.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    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, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 262, __pyx_L1_error)
  }
  __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];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_9pylsewave_5cynum_cpwgrad(__pyx_v_inarr, __pyx_v_out, __pyx_v_dx, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __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_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inarr.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pylsewave.cynum.cpwgrad", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inarr.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":270
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def cwrite2file(string filename, double[:, ::1] u):             # <<<<<<<<<<<<<<
 *     """
 *     Function to write results in a file.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_7cwrite2file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_6cwrite2file[] = "\n    Function to write results in a file.\n\n    :param filename: the name of the file\n    :param u: the solution vetctor\n    :return: int\n    ";
static PyMethodDef __pyx_mdef_9pylsewave_5cynum_7cwrite2file = {"cwrite2file", (PyCFunction)__pyx_pw_9pylsewave_5cynum_7cwrite2file, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_6cwrite2file};
static PyObject *__pyx_pw_9pylsewave_5cynum_7cwrite2file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  std::string __pyx_v_filename;
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cwrite2file (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_u,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_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cwrite2file", 1, 2, 2, 1); __PYX_ERR(0, 270, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cwrite2file") < 0)) __PYX_ERR(0, 270, __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_filename = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L3_error)
    __pyx_v_u = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[1]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 270, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cwrite2file", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 270, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cwrite2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_6cwrite2file(__pyx_self, __pyx_v_filename, __pyx_v_u);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_6cwrite2file(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_filename, __Pyx_memviewslice __pyx_v_u) {
  int __pyx_v_rws;
  int __pyx_v_clms;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("cwrite2file", 0);

  /* "pylsewave/cynum.pyx":279
 *     """
 *     cdef int rws, clms
 *     rws = u.shape[0]             # <<<<<<<<<<<<<<
 *     clms = u.shape[1]
 *     return write2file(filename, &u[0, 0], rws, clms)
 */
  __pyx_v_rws = (__pyx_v_u.shape[0]);

  /* "pylsewave/cynum.pyx":280
 *     cdef int rws, clms
 *     rws = u.shape[0]
 *     clms = u.shape[1]             # <<<<<<<<<<<<<<
 *     return write2file(filename, &u[0, 0], rws, clms)
 * 
 */
  __pyx_v_clms = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":281
 *     rws = u.shape[0]
 *     clms = u.shape[1]
 *     return write2file(filename, &u[0, 0], rws, clms)             # <<<<<<<<<<<<<<
 * 
 * PRINT_STATUS = False
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(ios_efile::write2file(__pyx_v_filename, (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_1 * __pyx_v_u.strides[0]) )) + __pyx_t_2)) )))), __pyx_v_rws, __pyx_v_clms)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":270
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def cwrite2file(string filename, double[:, ::1] u):             # <<<<<<<<<<<<<<
 *     """
 *     Function to write results in a file.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pylsewave.cynum.cwrite2file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":336
 *     cdef double delta, Re, _rho, _mu
 *     cdef vector[cvessel] vessels
 *     def __init__(self, mesh, rho, mu, Re=None):             # <<<<<<<<<<<<<<
 *         self.mesh = mesh
 *         if Re is not None:
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_5cPDEm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_5cPDEm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mesh = 0;
  PyObject *__pyx_v_rho = 0;
  PyObject *__pyx_v_mu = 0;
  PyObject *__pyx_v_Re = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mesh,&__pyx_n_s_rho,&__pyx_n_s_mu,&__pyx_n_s_Re,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_mesh)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 336, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mu)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 336, __pyx_L3_error)
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Re);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 336, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_mesh = values[0];
    __pyx_v_rho = values[1];
    __pyx_v_mu = values[2];
    __pyx_v_Re = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 336, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5cPDEm___init__(((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_v_self), __pyx_v_mesh, __pyx_v_rho, __pyx_v_mu, __pyx_v_Re);

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

static int __pyx_pf_9pylsewave_5cynum_5cPDEm___init__(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, PyObject *__pyx_v_mesh, PyObject *__pyx_v_rho, PyObject *__pyx_v_mu, PyObject *__pyx_v_Re) {
  Py_ssize_t __pyx_v_siz;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  double __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pylsewave/cynum.pyx":337
 *     cdef vector[cvessel] vessels
 *     def __init__(self, mesh, rho, mu, Re=None):
 *         self.mesh = mesh             # <<<<<<<<<<<<<<
 *         if Re is not None:
 *             self.Re = Re
 */
  __Pyx_INCREF(__pyx_v_mesh);
  __Pyx_GIVEREF(__pyx_v_mesh);
  __Pyx_GOTREF(__pyx_v_self->mesh);
  __Pyx_DECREF(__pyx_v_self->mesh);
  __pyx_v_self->mesh = __pyx_v_mesh;

  /* "pylsewave/cynum.pyx":338
 *     def __init__(self, mesh, rho, mu, Re=None):
 *         self.mesh = mesh
 *         if Re is not None:             # <<<<<<<<<<<<<<
 *             self.Re = Re
 *         if rho is not None:
 */
  __pyx_t_1 = (__pyx_v_Re != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pylsewave/cynum.pyx":339
 *         self.mesh = mesh
 *         if Re is not None:
 *             self.Re = Re             # <<<<<<<<<<<<<<
 *         if rho is not None:
 *             self._rho = rho
 */
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_Re); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L1_error)
    __pyx_v_self->Re = __pyx_t_3;

    /* "pylsewave/cynum.pyx":338
 *     def __init__(self, mesh, rho, mu, Re=None):
 *         self.mesh = mesh
 *         if Re is not None:             # <<<<<<<<<<<<<<
 *             self.Re = Re
 *         if rho is not None:
 */
  }

  /* "pylsewave/cynum.pyx":340
 *         if Re is not None:
 *             self.Re = Re
 *         if rho is not None:             # <<<<<<<<<<<<<<
 *             self._rho = rho
 *         if mu is not None:
 */
  __pyx_t_2 = (__pyx_v_rho != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pylsewave/cynum.pyx":341
 *             self.Re = Re
 *         if rho is not None:
 *             self._rho = rho             # <<<<<<<<<<<<<<
 *         if mu is not None:
 *             self._mu = mu
 */
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_rho); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L1_error)
    __pyx_v_self->_rho = __pyx_t_3;

    /* "pylsewave/cynum.pyx":340
 *         if Re is not None:
 *             self.Re = Re
 *         if rho is not None:             # <<<<<<<<<<<<<<
 *             self._rho = rho
 *         if mu is not None:
 */
  }

  /* "pylsewave/cynum.pyx":342
 *         if rho is not None:
 *             self._rho = rho
 *         if mu is not None:             # <<<<<<<<<<<<<<
 *             self._mu = mu
 *         cdef Py_ssize_t siz, i
 */
  __pyx_t_1 = (__pyx_v_mu != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pylsewave/cynum.pyx":343
 *             self._rho = rho
 *         if mu is not None:
 *             self._mu = mu             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t siz, i
 *         siz = len(self.mesh.vessels)
 */
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_mu); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L1_error)
    __pyx_v_self->_mu = __pyx_t_3;

    /* "pylsewave/cynum.pyx":342
 *         if rho is not None:
 *             self._rho = rho
 *         if mu is not None:             # <<<<<<<<<<<<<<
 *             self._mu = mu
 *         cdef Py_ssize_t siz, i
 */
  }

  /* "pylsewave/cynum.pyx":345
 *             self._mu = mu
 *         cdef Py_ssize_t siz, i
 *         siz = len(self.mesh.vessels)             # <<<<<<<<<<<<<<
 *         self.vessels.resize(siz)
 *         # set the vessels
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_siz = __pyx_t_5;

  /* "pylsewave/cynum.pyx":346
 *         cdef Py_ssize_t siz, i
 *         siz = len(self.mesh.vessels)
 *         self.vessels.resize(siz)             # <<<<<<<<<<<<<<
 *         # set the vessels
 *         self.set_vessels(self.vessels, siz)
 */
  try {
    __pyx_v_self->vessels.resize(__pyx_v_siz);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 346, __pyx_L1_error)
  }

  /* "pylsewave/cynum.pyx":348
 *         self.vessels.resize(siz)
 *         # set the vessels
 *         self.set_vessels(self.vessels, siz)             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_vtab)->set_vessels(__pyx_v_self, __pyx_v_self->vessels, __pyx_v_siz, 0);

  /* "pylsewave/cynum.pyx":336
 *     cdef double delta, Re, _rho, _mu
 *     cdef vector[cvessel] vessels
 *     def __init__(self, mesh, rho, mu, Re=None):             # <<<<<<<<<<<<<<
 *         self.mesh = mesh
 *         if Re is not None:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pylsewave.cynum.cPDEm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":351
 * 
 *     @cython.cdivision(True)
 *     cpdef void set_boundary_layer_th(self, double T, int no_cycles):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the boundary layer.
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_3set_boundary_layer_th(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_5cPDEm_set_boundary_layer_th(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, double __pyx_v_T, int __pyx_v_no_cycles, int __pyx_skip_dispatch) {
  double __pyx_v__nu;
  double __pyx_v_T_cycle;
  __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;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  double __pyx_t_9;
  __Pyx_RefNannySetupContext("set_boundary_layer_th", 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_set_boundary_layer_th); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_3set_boundary_layer_th)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_no_cycles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 351, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":362
 *         :param int no_cycles: No of cycles that the simulation will run
 *         """
 *         cdef double _nu = self._mu / self._rho             # <<<<<<<<<<<<<<
 *         cdef double T_cycle = T / no_cycles
 *         self.delta = np.power((_nu * T_cycle) / (2. * np.pi), 0.5)
 */
  __pyx_v__nu = (__pyx_v_self->_mu / __pyx_v_self->_rho);

  /* "pylsewave/cynum.pyx":363
 *         """
 *         cdef double _nu = self._mu / self._rho
 *         cdef double T_cycle = T / no_cycles             # <<<<<<<<<<<<<<
 *         self.delta = np.power((_nu * T_cycle) / (2. * np.pi), 0.5)
 * 
 */
  __pyx_v_T_cycle = (__pyx_v_T / __pyx_v_no_cycles);

  /* "pylsewave/cynum.pyx":364
 *         cdef double _nu = self._mu / self._rho
 *         cdef double T_cycle = T / no_cycles
 *         self.delta = np.power((_nu * T_cycle) / (2. * np.pi), 0.5)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_power); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble((__pyx_v__nu * __pyx_v_T_cycle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Multiply(__pyx_float_2_, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_2 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_t_8) {
    __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __pyx_t_8 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_7, __pyx_t_4);
  __Pyx_INCREF(__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_float_0_5);
  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_7, __pyx_float_0_5);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->delta = __pyx_t_9;

  /* "pylsewave/cynum.pyx":351
 * 
 *     @cython.cdivision(True)
 *     cpdef void set_boundary_layer_th(self, double T, int no_cycles):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the boundary layer.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEm.set_boundary_layer_th", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_3set_boundary_layer_th(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_5cPDEm_2set_boundary_layer_th[] = "\n        Method to calculate the boundary layer.\n\n        .. math::\n\n            \\delta = \\sqrt{\\frac{\\nu T_{cycle}}{2 \\pi}}\n\n        :param double T: Total period of the simulation\n        :param int no_cycles: No of cycles that the simulation will run\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_3set_boundary_layer_th(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_T;
  int __pyx_v_no_cycles;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_boundary_layer_th (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_T,&__pyx_n_s_no_cycles,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_T)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_no_cycles)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_boundary_layer_th", 1, 2, 2, 1); __PYX_ERR(0, 351, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_boundary_layer_th") < 0)) __PYX_ERR(0, 351, __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_T = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_T == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L3_error)
    __pyx_v_no_cycles = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_no_cycles == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_boundary_layer_th", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 351, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEm.set_boundary_layer_th", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5cPDEm_2set_boundary_layer_th(((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_v_self), __pyx_v_T, __pyx_v_no_cycles);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_2set_boundary_layer_th(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, double __pyx_v_T, int __pyx_v_no_cycles) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_boundary_layer_th", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_5cPDEm_set_boundary_layer_th(__pyx_v_self, __pyx_v_T, __pyx_v_no_cycles, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __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("pylsewave.cynum.cPDEm.set_boundary_layer_th", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":367
 * 
 *     @property
 *     def delta(self):             # <<<<<<<<<<<<<<
 *         return self.delta
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_5delta_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_5delta_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5cPDEm_5delta___get__(((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_5delta___get__(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":368
 *     @property
 *     def delta(self):
 *         return self.delta             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->delta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":367
 * 
 *     @property
 *     def delta(self):             # <<<<<<<<<<<<<<
 *         return self.delta
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cPDEm.delta.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":371
 * 
 * 
 *     cpdef void set_vessels(self, vector[cvessel] &vectorV, int siz):             # <<<<<<<<<<<<<<
 *         for i in range(siz):
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_5set_vessels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_5cPDEm_set_vessels(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, CYTHON_UNUSED std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &__pyx_v_vectorV, int __pyx_v_siz, int __pyx_skip_dispatch) {
  int __pyx_v_i;
  __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;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("set_vessels", 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_set_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_5set_vessels)) {
      __pyx_t_3 = __pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel(__pyx_v_vectorV); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_siz); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":372
 * 
 *     cpdef void set_vessels(self, vector[cvessel] &vectorV, int siz):
 *         for i in range(siz):             # <<<<<<<<<<<<<<
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 */
  __pyx_t_9 = __pyx_v_siz;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "pylsewave/cynum.pyx":373
 *     cpdef void set_vessels(self, vector[cvessel] &vectorV, int siz):
 *         for i in range(siz):
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0             # <<<<<<<<<<<<<<
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_r0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 373, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).r0, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).r0 = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":374
 *         for i in range(siz):
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0             # <<<<<<<<<<<<<<
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_f_r0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).f_r0, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).f_r0 = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":375
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)             # <<<<<<<<<<<<<<
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_interpolate_R0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 375, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).interpolate_R0p, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).interpolate_R0p = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":376
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)             # <<<<<<<<<<<<<<
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_interpolate_R0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).interpolate_R0m, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).interpolate_R0m = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":377
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph             # <<<<<<<<<<<<<<
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh
 *             self.vessels[i].df_dr0 = self.mesh.vessels[i].df_dr0
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_f_r0_ph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).f_r0_ph, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).f_r0_ph = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":378
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dr0 = self.mesh.vessels[i].df_dr0
 *             self.vessels[i].df_dx = self.mesh.vessels[i].df_dx
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_f_r0_mh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).f_r0_mh, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).f_r0_mh = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":379
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh
 *             self.vessels[i].df_dr0 = self.mesh.vessels[i].df_dr0             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dx = self.mesh.vessels[i].df_dx
 *             self.vessels[i].df_dr0_ph = self.mesh.vessels[i].df_dr0_ph
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dr0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 379, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).df_dr0, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).df_dr0 = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":380
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh
 *             self.vessels[i].df_dr0 = self.mesh.vessels[i].df_dr0
 *             self.vessels[i].df_dx = self.mesh.vessels[i].df_dx             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dr0_ph = self.mesh.vessels[i].df_dr0_ph
 *             self.vessels[i].df_dx_ph = self.mesh.vessels[i].df_dx_ph
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 380, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).df_dx, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).df_dx = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":381
 *             self.vessels[i].df_dr0 = self.mesh.vessels[i].df_dr0
 *             self.vessels[i].df_dx = self.mesh.vessels[i].df_dx
 *             self.vessels[i].df_dr0_ph = self.mesh.vessels[i].df_dr0_ph             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dx_ph = self.mesh.vessels[i].df_dx_ph
 *             self.vessels[i].df_dr0_mh = self.mesh.vessels[i].df_dr0_mh
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dr0_ph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 381, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).df_dr0_ph, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).df_dr0_ph = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":382
 *             self.vessels[i].df_dx = self.mesh.vessels[i].df_dx
 *             self.vessels[i].df_dr0_ph = self.mesh.vessels[i].df_dr0_ph
 *             self.vessels[i].df_dx_ph = self.mesh.vessels[i].df_dx_ph             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dr0_mh = self.mesh.vessels[i].df_dr0_mh
 *             self.vessels[i].df_dx_mh = self.mesh.vessels[i].df_dx_mh
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dx_ph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).df_dx_ph, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).df_dx_ph = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":383
 *             self.vessels[i].df_dr0_ph = self.mesh.vessels[i].df_dr0_ph
 *             self.vessels[i].df_dx_ph = self.mesh.vessels[i].df_dx_ph
 *             self.vessels[i].df_dr0_mh = self.mesh.vessels[i].df_dr0_mh             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dx_mh = self.mesh.vessels[i].df_dx_mh
 *             self.vessels[i].L = self.mesh.vessels[i].length
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dr0_mh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 383, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).df_dr0_mh, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).df_dr0_mh = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":384
 *             self.vessels[i].df_dx_ph = self.mesh.vessels[i].df_dx_ph
 *             self.vessels[i].df_dr0_mh = self.mesh.vessels[i].df_dr0_mh
 *             self.vessels[i].df_dx_mh = self.mesh.vessels[i].df_dx_mh             # <<<<<<<<<<<<<<
 *             self.vessels[i].L = self.mesh.vessels[i].length
 *             self.vessels[i].dx = self.mesh.vessels[i].dx
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dx_mh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 384, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).df_dx_mh, 0);
    (__pyx_v_self->vessels[__pyx_v_i]).df_dx_mh = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":385
 *             self.vessels[i].df_dr0_mh = self.mesh.vessels[i].df_dr0_mh
 *             self.vessels[i].df_dx_mh = self.mesh.vessels[i].df_dx_mh
 *             self.vessels[i].L = self.mesh.vessels[i].length             # <<<<<<<<<<<<<<
 *             self.vessels[i].dx = self.mesh.vessels[i].dx
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->vessels[__pyx_v_i]).L = __pyx_t_12;

    /* "pylsewave/cynum.pyx":386
 *             self.vessels[i].df_dx_mh = self.mesh.vessels[i].df_dx_mh
 *             self.vessels[i].L = self.mesh.vessels[i].length
 *             self.vessels[i].dx = self.mesh.vessels[i].dx             # <<<<<<<<<<<<<<
 * 
 *             if self.mesh.vessels[i].RLC is not None:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->vessels[__pyx_v_i]).dx = __pyx_t_12;

    /* "pylsewave/cynum.pyx":388
 *             self.vessels[i].dx = self.mesh.vessels[i].dx
 * 
 *             if self.mesh.vessels[i].RLC is not None:             # <<<<<<<<<<<<<<
 *                 self.vessels[i].RLC = np.array(list(self.mesh.vessels[i].RLC.values()), np.float)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RLC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_13 = (__pyx_t_1 != Py_None);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = (__pyx_t_13 != 0);
    if (__pyx_t_14) {

      /* "pylsewave/cynum.pyx":389
 * 
 *             if self.mesh.vessels[i].RLC is not None:
 *                 self.vessels[i].RLC = np.array(list(self.mesh.vessels[i].RLC.values()), np.float)             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_RLC); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_8) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_t_8);
      __pyx_t_4 = 0;
      __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 389, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_self->vessels[__pyx_v_i]).RLC, 0);
      (__pyx_v_self->vessels[__pyx_v_i]).RLC = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":388
 *             self.vessels[i].dx = self.mesh.vessels[i].dx
 * 
 *             if self.mesh.vessels[i].RLC is not None:             # <<<<<<<<<<<<<<
 *                 self.vessels[i].RLC = np.array(list(self.mesh.vessels[i].RLC.values()), np.float)
 * 
 */
    }
  }

  /* "pylsewave/cynum.pyx":371
 * 
 * 
 *     cpdef void set_vessels(self, vector[cvessel] &vectorV, int siz):             # <<<<<<<<<<<<<<
 *         for i in range(siz):
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEm.set_vessels", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_5set_vessels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_5set_vessels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_v_vectorV;
  int __pyx_v_siz;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_vessels (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vectorV,&__pyx_n_s_siz,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_vectorV)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_siz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_vessels", 1, 2, 2, 1); __PYX_ERR(0, 371, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_vessels") < 0)) __PYX_ERR(0, 371, __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_vectorV = __pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 371, __pyx_L3_error)
    __pyx_v_siz = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_siz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 371, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_vessels", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 371, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEm.set_vessels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5cPDEm_4set_vessels(((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_v_self), __pyx_v_vectorV, __pyx_v_siz);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_4set_vessels(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_v_vectorV, int __pyx_v_siz) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_vessels", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_5cPDEm_set_vessels(__pyx_v_self, __pyx_v_vectorV, __pyx_v_siz, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __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("pylsewave.cynum.cPDEm.set_vessels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":395
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int flux(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_F) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

static int __pyx_f_9pylsewave_5cynum_5cPDEm_flux(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_F) {
  double __pyx_v_A0;
  double __pyx_v_f_r0;
  __pyx_t_5numpy_intp_t __pyx_v_siz;
  __pyx_t_5numpy_intp_t __pyx_v_i;
  int __pyx_r;
  __pyx_t_5numpy_intp_t __pyx_t_1;
  __pyx_t_5numpy_intp_t __pyx_t_2;
  __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;

  /* "pylsewave/cynum.pyx":410
 *         cdef np.intp_t siz, i
 * 
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         if x == 0:
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":412
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":413
 * 
 *         if x == 0:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":414
 *         if x == 0:
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 out_F[0, i] = u[1, i]
 */
      __pyx_t_3 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).r0;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_4 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_4)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":415
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]             # <<<<<<<<<<<<<<
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 */
      __pyx_t_3 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_5 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_5)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":416
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 out_F[0, i] = u[1, i]             # <<<<<<<<<<<<<<
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 *         elif x == 1:
 */
      __pyx_t_6 = 1;
      __pyx_t_7 = __pyx_v_i;
      __pyx_t_8 = 0;
      __pyx_t_9 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_8 * __pyx_v_out_F.strides[0]) )) + __pyx_t_9)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_6 * __pyx_v_u.strides[0]) )) + __pyx_t_7)) )));

      /* "pylsewave/cynum.pyx":417
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             for i in range(siz):
 */
      __pyx_t_10 = 1;
      __pyx_t_11 = __pyx_v_i;
      __pyx_t_12 = 1;
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_14 = 0;
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_16 = 0;
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = 1;
      __pyx_t_19 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_18 * __pyx_v_out_F.strides[0]) )) + __pyx_t_19)) )) = ((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_10 * __pyx_v_u.strides[0]) )) + __pyx_t_11)) ))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_12 * __pyx_v_u.strides[0]) )) + __pyx_t_13)) )))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_14 * __pyx_v_u.strides[0]) )) + __pyx_t_15)) )))) + ((__pyx_v_f_r0 / __pyx_v_self->_rho) * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_16 * __pyx_v_u.strides[0]) )) + __pyx_t_17)) )))))));
    }

    /* "pylsewave/cynum.pyx":412
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":418
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 */
    case 1:

    /* "pylsewave/cynum.pyx":419
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 *         elif x == 1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":420
 *         elif x == 1:
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 out_F[0, i] = u[1, i]
 */
      __pyx_t_3 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).interpolate_R0p;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_20 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_20)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":421
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]             # <<<<<<<<<<<<<<
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 */
      __pyx_t_3 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_21 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_21)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":422
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 out_F[0, i] = u[1, i]             # <<<<<<<<<<<<<<
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 *         elif x == -1:
 */
      __pyx_t_22 = 1;
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_24 = 0;
      __pyx_t_25 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_24 * __pyx_v_out_F.strides[0]) )) + __pyx_t_25)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_22 * __pyx_v_u.strides[0]) )) + __pyx_t_23)) )));

      /* "pylsewave/cynum.pyx":423
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])             # <<<<<<<<<<<<<<
 *         elif x == -1:
 *             for i in range(siz):
 */
      __pyx_t_26 = 1;
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = 1;
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_30 = 0;
      __pyx_t_31 = __pyx_v_i;
      __pyx_t_32 = 0;
      __pyx_t_33 = __pyx_v_i;
      __pyx_t_34 = 1;
      __pyx_t_35 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_34 * __pyx_v_out_F.strides[0]) )) + __pyx_t_35)) )) = ((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_26 * __pyx_v_u.strides[0]) )) + __pyx_t_27)) ))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_28 * __pyx_v_u.strides[0]) )) + __pyx_t_29)) )))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_30 * __pyx_v_u.strides[0]) )) + __pyx_t_31)) )))) + ((__pyx_v_f_r0 / __pyx_v_self->_rho) * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_32 * __pyx_v_u.strides[0]) )) + __pyx_t_33)) )))))));
    }

    /* "pylsewave/cynum.pyx":418
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":424
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 */
    case -1L:

    /* "pylsewave/cynum.pyx":425
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 *         elif x == -1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":426
 *         elif x == -1:
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 out_F[0, i] = u[1, i]
 */
      __pyx_t_3 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).interpolate_R0m;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_36 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_36)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":427
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]             # <<<<<<<<<<<<<<
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 */
      __pyx_t_3 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_37 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_37)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":428
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 out_F[0, i] = u[1, i]             # <<<<<<<<<<<<<<
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 * 
 */
      __pyx_t_38 = 1;
      __pyx_t_39 = __pyx_v_i;
      __pyx_t_40 = 0;
      __pyx_t_41 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_40 * __pyx_v_out_F.strides[0]) )) + __pyx_t_41)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_38 * __pyx_v_u.strides[0]) )) + __pyx_t_39)) )));

      /* "pylsewave/cynum.pyx":429
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
      __pyx_t_42 = 1;
      __pyx_t_43 = __pyx_v_i;
      __pyx_t_44 = 1;
      __pyx_t_45 = __pyx_v_i;
      __pyx_t_46 = 0;
      __pyx_t_47 = __pyx_v_i;
      __pyx_t_48 = 0;
      __pyx_t_49 = __pyx_v_i;
      __pyx_t_50 = 1;
      __pyx_t_51 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_50 * __pyx_v_out_F.strides[0]) )) + __pyx_t_51)) )) = ((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_42 * __pyx_v_u.strides[0]) )) + __pyx_t_43)) ))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_44 * __pyx_v_u.strides[0]) )) + __pyx_t_45)) )))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_46 * __pyx_v_u.strides[0]) )) + __pyx_t_47)) )))) + ((__pyx_v_f_r0 / __pyx_v_self->_rho) * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_48 * __pyx_v_u.strides[0]) )) + __pyx_t_49)) )))))));
    }

    /* "pylsewave/cynum.pyx":424
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":431
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + (f_r0/self._rho)*sqrt(A0*u[0, i])
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":395
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int flux(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_F) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":437
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void flux_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_f):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_7flux_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_5cPDEm_flux_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  double __pyx_v_f_r0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  __Pyx_RefNannySetupContext("flux_i", 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_flux_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_7flux_i)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_out_f, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":452
 *         cdef np.intp_t siz, i
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":453
 * 
 *         if x == 0:
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             out_f[0] = u[1]
 */
    __pyx_t_12 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_13 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_13)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":454
 *         if x == 0:
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]             # <<<<<<<<<<<<<<
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 */
    __pyx_t_12 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_14 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_14)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":455
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             out_f[0] = u[1]             # <<<<<<<<<<<<<<
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 *         elif x == 1:
 */
    __pyx_t_15 = 1;
    __pyx_t_16 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_16)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_15)) )));

    /* "pylsewave/cynum.pyx":456
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 */
    __pyx_t_17 = 1;
    __pyx_t_18 = 1;
    __pyx_t_19 = 0;
    __pyx_t_20 = 0;
    __pyx_t_21 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_21)) )) = ((((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_17)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_18)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_19)) )))) + ((__pyx_v_f_r0 / __pyx_v_self->_rho) * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_20)) )))))));

    /* "pylsewave/cynum.pyx":452
 *         cdef np.intp_t siz, i
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 */
    break;

    /* "pylsewave/cynum.pyx":457
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 */
    case 1:

    /* "pylsewave/cynum.pyx":458
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 *         elif x == 1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             out_f[0] = u[1]
 */
    __pyx_t_12 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).interpolate_R0p;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_22 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_22)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":459
 *         elif x == 1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]             # <<<<<<<<<<<<<<
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 */
    __pyx_t_12 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_23 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_23)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":460
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             out_f[0] = u[1]             # <<<<<<<<<<<<<<
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 *         elif x == -1:
 */
    __pyx_t_24 = 1;
    __pyx_t_25 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_25)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_24)) )));

    /* "pylsewave/cynum.pyx":461
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])             # <<<<<<<<<<<<<<
 *         elif x == -1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 */
    __pyx_t_26 = 1;
    __pyx_t_27 = 1;
    __pyx_t_28 = 0;
    __pyx_t_29 = 0;
    __pyx_t_30 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_30)) )) = ((((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_26)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_27)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_28)) )))) + ((__pyx_v_f_r0 / __pyx_v_self->_rho) * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_29)) )))))));

    /* "pylsewave/cynum.pyx":457
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 */
    break;

    /* "pylsewave/cynum.pyx":462
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 */
    case -1L:

    /* "pylsewave/cynum.pyx":463
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 *         elif x == -1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             out_f[0] = u[1]
 */
    __pyx_t_12 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).interpolate_R0m;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_31 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_31)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":464
 *         elif x == -1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]             # <<<<<<<<<<<<<<
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 */
    __pyx_t_12 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_32 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_32)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":465
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             out_f[0] = u[1]             # <<<<<<<<<<<<<<
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 * 
 */
    __pyx_t_33 = 1;
    __pyx_t_34 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_34)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_33)) )));

    /* "pylsewave/cynum.pyx":466
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])             # <<<<<<<<<<<<<<
 * 
 *     property mesh:
 */
    __pyx_t_35 = 1;
    __pyx_t_36 = 1;
    __pyx_t_37 = 0;
    __pyx_t_38 = 0;
    __pyx_t_39 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_39)) )) = ((((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_35)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_36)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_37)) )))) + ((__pyx_v_f_r0 / __pyx_v_self->_rho) * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_38)) )))))));

    /* "pylsewave/cynum.pyx":462
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/self._rho)*sqrt(A0*u[0])
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":437
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void flux_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_f):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEm.flux_i", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_7flux_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_5cPDEm_6flux_i[] = "\n        Method to calculate the Flux term.\n\n        :param u: the solution vector u\n        :type priority: float or ndarray[ndim=1, dtype=double]\n        :param x: the spatial point index\n        :type priority: int\n        :param int vessel_index: the unique vessel Id\n        :param ndarray[ndim=1, dtype=double] out_F: the flux vector\n        :return: int\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_7flux_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_x;
  int __pyx_v_index;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out_f = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flux_i (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_x,&__pyx_n_s_index,&__pyx_n_s_vessel_index,&__pyx_n_s_out_f,0};
    PyObject* values[5] = {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  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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 1); __PYX_ERR(0, 437, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 2); __PYX_ERR(0, 437, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 3); __PYX_ERR(0, 437, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_f)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 4); __PYX_ERR(0, 437, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flux_i") < 0)) __PYX_ERR(0, 437, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
    }
    __pyx_v_u = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 437, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L3_error)
    __pyx_v_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L3_error)
    __pyx_v_out_f = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[4]); if (unlikely(!__pyx_v_out_f.memview)) __PYX_ERR(0, 437, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 437, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEm.flux_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5cPDEm_6flux_i(((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_v_self), __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_f);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_6flux_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("flux_i", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_5cPDEm_flux_i(__pyx_v_self, __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_f, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __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("pylsewave.cynum.cPDEm.flux_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out_f, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":469
 * 
 *     property mesh:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.mesh
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_4mesh_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_4mesh_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5cPDEm_4mesh___get__(((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_4mesh___get__(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":470
 *     property mesh:
 *         def __get__(self):
 *             return self.mesh             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, mesh):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->mesh);
  __pyx_r = __pyx_v_self->mesh;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":469
 * 
 *     property mesh:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.mesh
 * 
 */

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

/* "pylsewave/cynum.pyx":472
 *             return self.mesh
 * 
 *         def __set__(self, mesh):             # <<<<<<<<<<<<<<
 *             self.mesh = mesh
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_5cPDEm_4mesh_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mesh); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_5cPDEm_4mesh_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mesh) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5cPDEm_4mesh_2__set__(((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_v_self), ((PyObject *)__pyx_v_mesh));

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

static int __pyx_pf_9pylsewave_5cynum_5cPDEm_4mesh_2__set__(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, PyObject *__pyx_v_mesh) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pylsewave/cynum.pyx":473
 * 
 *         def __set__(self, mesh):
 *             self.mesh = mesh             # <<<<<<<<<<<<<<
 * 
 *     cdef vector[cvessel] get_vessels(self):
 */
  __Pyx_INCREF(__pyx_v_mesh);
  __Pyx_GIVEREF(__pyx_v_mesh);
  __Pyx_GOTREF(__pyx_v_self->mesh);
  __Pyx_DECREF(__pyx_v_self->mesh);
  __pyx_v_self->mesh = __pyx_v_mesh;

  /* "pylsewave/cynum.pyx":472
 *             return self.mesh
 * 
 *         def __set__(self, mesh):             # <<<<<<<<<<<<<<
 *             self.mesh = mesh
 * 
 */

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

/* "pylsewave/cynum.pyx":475
 *             self.mesh = mesh
 * 
 *     cdef vector[cvessel] get_vessels(self):             # <<<<<<<<<<<<<<
 *         return self.vessels
 * 
 */

static std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_f_9pylsewave_5cynum_5cPDEm_get_vessels(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self) {
  std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_vessels", 0);

  /* "pylsewave/cynum.pyx":476
 * 
 *     cdef vector[cvessel] get_vessels(self):
 *         return self.vessels             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_self->vessels;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":475
 *             self.mesh = mesh
 * 
 *     cdef vector[cvessel] get_vessels(self):             # <<<<<<<<<<<<<<
 *         return self.vessels
 * 
 */

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

/* "pylsewave/cynum.pyx":482
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int source(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_S) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Source term.
 */

static int __pyx_f_9pylsewave_5cynum_5cPDEm_source(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_S) {
  double __pyx_v_A0;
  double __pyx_v_R;
  double __pyx_v_f_r0;
  double __pyx_v_df_dr0;
  double __pyx_v_df_dx;
  __pyx_t_5numpy_intp_t __pyx_v_siz;
  __pyx_t_5numpy_intp_t __pyx_v_i;
  double __pyx_v__nu;
  int __pyx_r;
  __pyx_t_5numpy_intp_t __pyx_t_1;
  __pyx_t_5numpy_intp_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;

  /* "pylsewave/cynum.pyx":495
 *         cdef double A0, R, f_r0, df_dr0, df_dx
 *         cdef np.intp_t siz, i
 *         cdef double _nu = ((self._mu)/self._rho)             # <<<<<<<<<<<<<<
 *         siz = u.shape[1]
 * 
 */
  __pyx_v__nu = (__pyx_v_self->_mu / __pyx_v_self->_rho);

  /* "pylsewave/cynum.pyx":496
 *         cdef np.intp_t siz, i
 *         cdef double _nu = ((self._mu)/self._rho)
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         if x == 0:
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":498
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":499
 * 
 *         if x == 0:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":500
 *         if x == 0:
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 */
      __pyx_t_3 = 0;
      __pyx_t_4 = __pyx_v_i;
      __pyx_v_R = sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_3 * __pyx_v_u.strides[0]) )) + __pyx_t_4)) ))) / M_PI));

      /* "pylsewave/cynum.pyx":501
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).r0;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_6 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_6)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":502
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]             # <<<<<<<<<<<<<<
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_7 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_7)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":503
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]             # <<<<<<<<<<<<<<
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dr0;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_8 = __pyx_v_i;
      __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_8)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":504
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 *                 df_dx = self.vessels[vessel_index].df_dx[i]             # <<<<<<<<<<<<<<
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i])/(self.delta*u[0, i])) +
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dx;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_9 = __pyx_v_i;
      __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_9)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":505
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0             # <<<<<<<<<<<<<<
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i])/(self.delta*u[0, i])) +
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 */
      __pyx_t_10 = 0;
      __pyx_t_11 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_10 * __pyx_v_out_S.strides[0]) )) + __pyx_t_11)) )) = 0.0;

      /* "pylsewave/cynum.pyx":506
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i])/(self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 *         elif x == 1:
 */
      __pyx_t_12 = 1;
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_14 = 0;
      __pyx_t_15 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":507
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i])/(self.delta*u[0, i])) +
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             for i in range(siz):
 */
      __pyx_t_16 = 0;
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = 0;
      __pyx_t_19 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":506
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i])/(self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 *         elif x == 1:
 */
      __pyx_t_20 = 1;
      __pyx_t_21 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_20 * __pyx_v_out_S.strides[0]) )) + __pyx_t_21)) )) = ((((((-2. * M_PI) * __pyx_v_R) * __pyx_v__nu) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_12 * __pyx_v_u.strides[0]) )) + __pyx_t_13)) )))) / (__pyx_v_self->delta * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_14 * __pyx_v_u.strides[0]) )) + __pyx_t_15)) ))))) + (((1. / __pyx_v_self->_rho) * (((2. * sqrt((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_16 * __pyx_v_u.strides[0]) )) + __pyx_t_17)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_18 * __pyx_v_u.strides[0]) )) + __pyx_t_19)) ))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));
    }

    /* "pylsewave/cynum.pyx":498
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    break;

    /* "pylsewave/cynum.pyx":508
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i])/(self.delta*u[0, i])) +
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    case 1:

    /* "pylsewave/cynum.pyx":509
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 *         elif x == 1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":510
 *         elif x == 1:
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 */
      __pyx_t_22 = 0;
      __pyx_t_23 = __pyx_v_i;
      __pyx_v_R = sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_22 * __pyx_v_u.strides[0]) )) + __pyx_t_23)) ))) / M_PI));

      /* "pylsewave/cynum.pyx":511
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).interpolate_R0p;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_24 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_24)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":512
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]             # <<<<<<<<<<<<<<
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_25 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_25)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":513
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]             # <<<<<<<<<<<<<<
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dr0_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_26 = __pyx_v_i;
      __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_26)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":514
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]             # <<<<<<<<<<<<<<
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i]) / (self.delta*u[0, i])) +
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dx_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_27 = __pyx_v_i;
      __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_27)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":515
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0             # <<<<<<<<<<<<<<
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 */
      __pyx_t_28 = 0;
      __pyx_t_29 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_28 * __pyx_v_out_S.strides[0]) )) + __pyx_t_29)) )) = 0.0;

      /* "pylsewave/cynum.pyx":516
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i]) / (self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 *         elif x == -1:
 */
      __pyx_t_30 = 1;
      __pyx_t_31 = __pyx_v_i;
      __pyx_t_32 = 0;
      __pyx_t_33 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":517
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 *         elif x == -1:
 *             for i in range(siz):
 */
      __pyx_t_34 = 0;
      __pyx_t_35 = __pyx_v_i;
      __pyx_t_36 = 0;
      __pyx_t_37 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":516
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i]) / (self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 *         elif x == -1:
 */
      __pyx_t_38 = 1;
      __pyx_t_39 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_38 * __pyx_v_out_S.strides[0]) )) + __pyx_t_39)) )) = ((((((-2. * M_PI) * __pyx_v_R) * __pyx_v__nu) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_30 * __pyx_v_u.strides[0]) )) + __pyx_t_31)) )))) / (__pyx_v_self->delta * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_32 * __pyx_v_u.strides[0]) )) + __pyx_t_33)) ))))) + (((1. / __pyx_v_self->_rho) * (((2. * sqrt((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_34 * __pyx_v_u.strides[0]) )) + __pyx_t_35)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_36 * __pyx_v_u.strides[0]) )) + __pyx_t_37)) ))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));
    }

    /* "pylsewave/cynum.pyx":508
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i])/(self.delta*u[0, i])) +
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    break;

    /* "pylsewave/cynum.pyx":518
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    case -1L:

    /* "pylsewave/cynum.pyx":519
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 *         elif x == -1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":520
 *         elif x == -1:
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 */
      __pyx_t_40 = 0;
      __pyx_t_41 = __pyx_v_i;
      __pyx_v_R = sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_40 * __pyx_v_u.strides[0]) )) + __pyx_t_41)) ))) / M_PI));

      /* "pylsewave/cynum.pyx":521
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).interpolate_R0m;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_42 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_42)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":522
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]             # <<<<<<<<<<<<<<
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_43 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_43)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":523
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]             # <<<<<<<<<<<<<<
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dr0_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_44 = __pyx_v_i;
      __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_44)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":524
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]             # <<<<<<<<<<<<<<
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 */
      __pyx_t_5 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dx_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_45 = __pyx_v_i;
      __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_45)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":525
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0             # <<<<<<<<<<<<<<
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 */
      __pyx_t_46 = 0;
      __pyx_t_47 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_46 * __pyx_v_out_S.strides[0]) )) + __pyx_t_47)) )) = 0.0;

      /* "pylsewave/cynum.pyx":526
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 * 
 */
      __pyx_t_48 = 1;
      __pyx_t_49 = __pyx_v_i;
      __pyx_t_50 = 0;
      __pyx_t_51 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":527
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
      __pyx_t_52 = 0;
      __pyx_t_53 = __pyx_v_i;
      __pyx_t_54 = 0;
      __pyx_t_55 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":526
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 * 
 */
      __pyx_t_56 = 1;
      __pyx_t_57 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_56 * __pyx_v_out_S.strides[0]) )) + __pyx_t_57)) )) = ((((((-2. * M_PI) * __pyx_v__nu) * __pyx_v_R) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_48 * __pyx_v_u.strides[0]) )) + __pyx_t_49)) )))) / (__pyx_v_self->delta * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_50 * __pyx_v_u.strides[0]) )) + __pyx_t_51)) ))))) + (((1. / __pyx_v_self->_rho) * (((2. * sqrt((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_52 * __pyx_v_u.strides[0]) )) + __pyx_t_53)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_54 * __pyx_v_u.strides[0]) )) + __pyx_t_55)) ))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));
    }

    /* "pylsewave/cynum.pyx":518
 *                 out_S[1, i] = (((-2.*M_PI*R*_nu*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":529
 *                                (1./self._rho)*(2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":482
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int source(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_S) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Source term.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":535
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void source_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_s):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Source term.
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_9source_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_5cPDEm_source_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  double __pyx_v_R;
  double __pyx_v_f_r0;
  double __pyx_v_df_dr0;
  double __pyx_v_df_dx;
  double __pyx_v__nu;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  __Pyx_RefNannySetupContext("source_i", 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_source_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_9source_i)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_out_s, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":547
 *         """
 *         cdef double A0, R, f_r0, df_dr0, df_dx
 *         cdef double _nu = ((self._mu)/self._rho)             # <<<<<<<<<<<<<<
 * 
 *         if x == 0:
 */
  __pyx_v__nu = (__pyx_v_self->_mu / __pyx_v_self->_rho);

  /* "pylsewave/cynum.pyx":549
 *         cdef double _nu = ((self._mu)/self._rho)
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":550
 * 
 *         if x == 0:
 *             R = sqrt(u[0] / M_PI)             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 */
    __pyx_t_12 = 0;
    __pyx_v_R = sqrt(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_12)) ))) / M_PI));

    /* "pylsewave/cynum.pyx":551
 *         if x == 0:
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_14 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_14)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":552
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]             # <<<<<<<<<<<<<<
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_15 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_15)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":553
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]             # <<<<<<<<<<<<<<
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dr0;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_16 = __pyx_v_index;
    __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_16)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":554
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 *             df_dx = self.vessels[vessel_index].df_dx[index]             # <<<<<<<<<<<<<<
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dx;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_17 = __pyx_v_index;
    __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_17)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":555
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0             # <<<<<<<<<<<<<<
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 */
    __pyx_t_18 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_18)) )) = 0.0;

    /* "pylsewave/cynum.pyx":556
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_19 = 1;
    __pyx_t_20 = 0;

    /* "pylsewave/cynum.pyx":557
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -             # <<<<<<<<<<<<<<
 *                          u[0] * df_dr0)*df_dx)
 *         elif x == 1:
 */
    __pyx_t_21 = 0;

    /* "pylsewave/cynum.pyx":558
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             R = sqrt(u[0] / M_PI)
 */
    __pyx_t_22 = 0;

    /* "pylsewave/cynum.pyx":556
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_23 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_23)) )) = ((((((-2. * M_PI) * __pyx_v__nu) * __pyx_v_R) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_19)) )))) / (__pyx_v_self->delta * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_20)) ))))) + (((1. / __pyx_v_self->_rho) * (((2. * sqrt((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_21)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_22)) ))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));

    /* "pylsewave/cynum.pyx":549
 *         cdef double _nu = ((self._mu)/self._rho)
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":559
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 */
    case 1:

    /* "pylsewave/cynum.pyx":560
 *                          u[0] * df_dr0)*df_dx)
 *         elif x == 1:
 *             R = sqrt(u[0] / M_PI)             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 */
    __pyx_t_24 = 0;
    __pyx_v_R = sqrt(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_24)) ))) / M_PI));

    /* "pylsewave/cynum.pyx":561
 *         elif x == 1:
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).interpolate_R0p;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_25 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_25)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":562
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]             # <<<<<<<<<<<<<<
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_26 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_26)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":563
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]             # <<<<<<<<<<<<<<
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dr0_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_27 = __pyx_v_index;
    __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_27)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":564
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]             # <<<<<<<<<<<<<<
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dx_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_28 = __pyx_v_index;
    __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_28)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":565
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0             # <<<<<<<<<<<<<<
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 */
    __pyx_t_29 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_29)) )) = 0.0;

    /* "pylsewave/cynum.pyx":566
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_30 = 1;
    __pyx_t_31 = 0;

    /* "pylsewave/cynum.pyx":567
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -             # <<<<<<<<<<<<<<
 *                          u[0] * df_dr0)*df_dx)
 * 
 */
    __pyx_t_32 = 0;

    /* "pylsewave/cynum.pyx":568
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 * 
 *         elif x == -1:
 */
    __pyx_t_33 = 0;

    /* "pylsewave/cynum.pyx":566
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_34 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_34)) )) = ((((((-2. * M_PI) * __pyx_v__nu) * __pyx_v_R) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_30)) )))) / (__pyx_v_self->delta * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_31)) ))))) + (((1. / __pyx_v_self->_rho) * (((2. * sqrt((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_32)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_33)) ))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));

    /* "pylsewave/cynum.pyx":559
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":570
 *                          u[0] * df_dr0)*df_dx)
 * 
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 */
    case -1L:

    /* "pylsewave/cynum.pyx":571
 * 
 *         elif x == -1:
 *             R = sqrt(u[0] / M_PI)             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 */
    __pyx_t_35 = 0;
    __pyx_v_R = sqrt(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_35)) ))) / M_PI));

    /* "pylsewave/cynum.pyx":572
 *         elif x == -1:
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).interpolate_R0m;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_36 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_36)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":573
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]             # <<<<<<<<<<<<<<
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_37 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_37)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":574
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]             # <<<<<<<<<<<<<<
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dr0_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_38 = __pyx_v_index;
    __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_38)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":575
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]             # <<<<<<<<<<<<<<
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 */
    __pyx_t_13 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).df_dx_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_39 = __pyx_v_index;
    __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_39)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":576
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0             # <<<<<<<<<<<<<<
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 */
    __pyx_t_40 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_40)) )) = 0.0;

    /* "pylsewave/cynum.pyx":577
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_41 = 1;
    __pyx_t_42 = 0;

    /* "pylsewave/cynum.pyx":578
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -             # <<<<<<<<<<<<<<
 *                          u[0] * df_dr0)*df_dx)
 * 
 */
    __pyx_t_43 = 0;

    /* "pylsewave/cynum.pyx":579
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
    __pyx_t_44 = 0;

    /* "pylsewave/cynum.pyx":577
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_45 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_45)) )) = ((((((-2. * M_PI) * __pyx_v__nu) * __pyx_v_R) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_41)) )))) / (__pyx_v_self->delta * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_42)) ))))) + (((1. / __pyx_v_self->_rho) * (((2. * sqrt((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_43)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_44)) ))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));

    /* "pylsewave/cynum.pyx":570
 *                          u[0] * df_dr0)*df_dx)
 * 
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":535
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void source_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_s):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Source term.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEm.source_i", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_9source_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_5cPDEm_8source_i[] = "\n        Method to calculate the Source term.\n\n        :param u: the solution vector u\n        :type priority: float or ndarray[ndim=1, dtype=double]\n        :param x: the spatial points discretising the 1D segments\n        :type priority: float or ndarray[ndim=1, dtype=double]\n        :param int vessel_index: the unique vessel Id\n        :param ndarray[ndim=1, dtype=double] out_S: the source vector \n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_9source_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_x;
  int __pyx_v_index;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out_s = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("source_i (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_x,&__pyx_n_s_index,&__pyx_n_s_vessel_index,&__pyx_n_s_out_s,0};
    PyObject* values[5] = {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  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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 1); __PYX_ERR(0, 535, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 2); __PYX_ERR(0, 535, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 3); __PYX_ERR(0, 535, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_s)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 4); __PYX_ERR(0, 535, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "source_i") < 0)) __PYX_ERR(0, 535, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
    }
    __pyx_v_u = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 535, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L3_error)
    __pyx_v_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L3_error)
    __pyx_v_out_s = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[4]); if (unlikely(!__pyx_v_out_s.memview)) __PYX_ERR(0, 535, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 535, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEm.source_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5cPDEm_8source_i(((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_v_self), __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_s);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_8source_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("source_i", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_5cPDEm_source_i(__pyx_v_self, __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_s, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pylsewave.cynum.cPDEm.source_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out_s, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":585
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef double pressure_i(self, double a, int index, int vessel_index) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute pressure from pressure-area relationship
 */

static double __pyx_f_9pylsewave_5cynum_5cPDEm_pressure_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index) {
  double __pyx_v_A0;
  double __pyx_v_out;
  double __pyx_r;
  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;

  /* "pylsewave/cynum.pyx":600
 *         cdef double A0
 *         cdef double out
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *         out = self.vessels[vessel_index].f_r0[index]*(1 - sqrt(A0 / a))
 *         return out
 */
  __pyx_t_1 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_1, 0);
  __pyx_t_2 = __pyx_v_index;
  __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_1.data) + __pyx_t_2)) ))), 2.0));
  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 0);

  /* "pylsewave/cynum.pyx":601
 *         cdef double out
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out = self.vessels[vessel_index].f_r0[index]*(1 - sqrt(A0 / a))             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
  __pyx_t_1 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_1, 0);
  __pyx_t_3 = __pyx_v_index;
  __pyx_v_out = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_1.data) + __pyx_t_3)) ))) * (1.0 - sqrt((__pyx_v_A0 / __pyx_v_a))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 0);

  /* "pylsewave/cynum.pyx":602
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out = self.vessels[vessel_index].f_r0[index]*(1 - sqrt(A0 / a))
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":585
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef double pressure_i(self, double a, int index, int vessel_index) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute pressure from pressure-area relationship
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":608
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cdef void pressure(self, double[:, ::1] u, int vessel_index, double[::1] out_p):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute pressure from pressure-area relationship
 */

static void __pyx_f_9pylsewave_5cynum_5cPDEm_pressure(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_p) {
  double __pyx_v_A0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_siz;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("pressure", 0);

  /* "pylsewave/cynum.pyx":623
 *         cdef double A0
 *         cdef Py_ssize_t i, siz
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":624
 *         cdef Py_ssize_t i, siz
 *         siz = u.shape[1]
 *         for i in range(siz):             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_p[i] = self.vessels[vessel_index].f_r0[i]*(1 - sqrt(A0 / u[0, i]))
 */
  __pyx_t_1 = __pyx_v_siz;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":625
 *         siz = u.shape[1]
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *             out_p[i] = self.vessels[vessel_index].f_r0[i]*(1 - sqrt(A0 / u[0, i]))
 * 
 */
    __pyx_t_3 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_3, 1);
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_4)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);

    /* "pylsewave/cynum.pyx":626
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_p[i] = self.vessels[vessel_index].f_r0[i]*(1 - sqrt(A0 / u[0, i]))             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
    __pyx_t_3 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_3, 1);
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_6 = 0;
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_8 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_p.data) + __pyx_t_8)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_5)) ))) * (1.0 - sqrt((__pyx_v_A0 / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_6 * __pyx_v_u.strides[0]) )) + __pyx_t_7)) )))))));
    __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
  }

  /* "pylsewave/cynum.pyx":608
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cdef void pressure(self, double[:, ::1] u, int vessel_index, double[::1] out_p):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute pressure from pressure-area relationship
 */

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

/* "pylsewave/cynum.pyx":632
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cpdef double compute_c_i(self, double a, int index, int vessel_index):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_11compute_c_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_9pylsewave_5cynum_5cPDEm_compute_c_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  double __pyx_v_out;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __Pyx_RefNannySetupContext("compute_c_i", 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_compute_c_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_11compute_c_i)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_10;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":647
 *         cdef double A0
 *         cdef double out
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *         out = -sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[index]*sqrt(A0/a))
 *         return out
 */
  __pyx_t_11 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
  __pyx_t_12 = __pyx_v_index;
  __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_12)) ))), 2.0));
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);

  /* "pylsewave/cynum.pyx":648
 *         cdef double out
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out = -sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[index]*sqrt(A0/a))             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
  __pyx_t_11 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
  __pyx_t_13 = __pyx_v_index;
  __pyx_v_out = (-sqrt((((0.5 / __pyx_v_self->_rho) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_13)) )))) * sqrt((__pyx_v_A0 / __pyx_v_a)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);

  /* "pylsewave/cynum.pyx":649
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out = -sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[index]*sqrt(A0/a))
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     # @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":632
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cpdef double compute_c_i(self, double a, int index, int vessel_index):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEm.compute_c_i", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_11compute_c_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_5cPDEm_10compute_c_i[] = "\n        Method to compute local wave speed\n\n        .. math::\n             c(A) = -\\sqrt{\\frac{1}{2 \\rho} f(R_0, k) \\sqrt{\\frac{A_0}{A}}}\n\n        :param A: cross-sectional area of vessel\n        :type priority: double\n        :param int index: the number or the node to be calculated\n        :param vessel_index: the vessel unique Id\n        :return: double\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_11compute_c_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_a;
  int __pyx_v_index;
  int __pyx_v_vessel_index;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_c_i (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_index,&__pyx_n_s_vessel_index,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_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c_i", 1, 3, 3, 1); __PYX_ERR(0, 632, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c_i", 1, 3, 3, 2); __PYX_ERR(0, 632, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_c_i") < 0)) __PYX_ERR(0, 632, __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_a = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L3_error)
    __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compute_c_i", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 632, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEm.compute_c_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5cPDEm_10compute_c_i(((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_v_self), __pyx_v_a, __pyx_v_index, __pyx_v_vessel_index);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_10compute_c_i(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("compute_c_i", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_9pylsewave_5cynum_5cPDEm_compute_c_i(__pyx_v_self, __pyx_v_a, __pyx_v_index, __pyx_v_vessel_index, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __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("pylsewave.cynum.cPDEm.compute_c_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":654
 *     # @cython.cdivision(True)
 *     # @cython.boundscheck(False)
 *     cpdef void compute_c(self, double[:, ::1] u, int vessel_index, double[::1] out_c):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_13compute_c(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_5cPDEm_compute_c(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_siz;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  double __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  __Pyx_RefNannySetupContext("compute_c", 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_compute_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_13compute_c)) {
      if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 654, __pyx_L1_error) }
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(!__pyx_v_out_c.memview)) { __Pyx_RaiseUnboundLocalError("out_c"); __PYX_ERR(0, 654, __pyx_L1_error) }
      __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_out_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":669
 *         cdef double A0
 *         cdef Py_ssize_t i, siz
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":670
 *         cdef Py_ssize_t i, siz
 *         siz = u.shape[1]
 *         for i in range(siz):             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_c[i] = -sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[i]*sqrt(A0/u[0, i]))
 */
  __pyx_t_8 = __pyx_v_siz;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_8; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "pylsewave/cynum.pyx":671
 *         siz = u.shape[1]
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *             out_c[i] = -sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[i]*sqrt(A0/u[0, i]))
 * 
 */
    if (unlikely(!(__pyx_v_self->vessels[__pyx_v_vessel_index]).r0.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 671, __pyx_L1_error)}
    __pyx_t_11 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_t_11.shape[0];
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_t_11.shape[0])) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      __PYX_ERR(0, 671, __pyx_L1_error)
    }
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_12)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);

    /* "pylsewave/cynum.pyx":672
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_c[i] = -sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[i]*sqrt(A0/u[0, i]))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_self->_rho == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 672, __pyx_L1_error)
    }
    if (unlikely(!(__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 672, __pyx_L1_error)}
    __pyx_t_11 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_t_11.shape[0];
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_t_11.shape[0])) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      __PYX_ERR(0, 672, __pyx_L1_error)
    }
    __pyx_t_15 = 0;
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_v_u.shape[0];
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_v_u.shape[0])) __pyx_t_13 = 0;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_v_u.shape[1];
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 1;
    } else if (unlikely(__pyx_t_16 >= __pyx_v_u.shape[1])) __pyx_t_13 = 1;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      __PYX_ERR(0, 672, __pyx_L1_error)
    }
    __pyx_t_17 = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_15 * __pyx_v_u.strides[0]) )) + __pyx_t_16)) )));
    if (unlikely(__pyx_t_17 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 672, __pyx_L1_error)
    }
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_v_out_c.shape[0];
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_18 >= __pyx_v_out_c.shape[0])) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      __PYX_ERR(0, 672, __pyx_L1_error)
    }
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_c.data) + __pyx_t_18)) )) = (-sqrt((((0.5 / __pyx_v_self->_rho) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_14)) )))) * sqrt((__pyx_v_A0 / __pyx_t_17)))));
    __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  }

  /* "pylsewave/cynum.pyx":654
 *     # @cython.cdivision(True)
 *     # @cython.boundscheck(False)
 *     cpdef void compute_c(self, double[:, ::1] u, int vessel_index, double[::1] out_c):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEm.compute_c", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_13compute_c(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_5cPDEm_12compute_c[] = "\n        Method to compute local wave speed\n\n        .. math::\n             c(A) = -\\sqrt{\\frac{1}{2 \\rho} f(R_0, k) \\sqrt{\\frac{A_0}{A}}}\n\n        :param u: solution vector\n        :type priority: ndarray[ndim=2, type=double]\n        :param int index: the number or the node to be calculated\n        :param vessel_index: the vessel unique Id\n        :param ndarray[ndim=2, type=double] out_c: the calculated wave speed vector\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_5cPDEm_13compute_c(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out_c = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_c (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_vessel_index,&__pyx_n_s_out_c,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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c", 1, 3, 3, 1); __PYX_ERR(0, 654, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c", 1, 3, 3, 2); __PYX_ERR(0, 654, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_c") < 0)) __PYX_ERR(0, 654, __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_u = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 654, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L3_error)
    __pyx_v_out_c = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2]); if (unlikely(!__pyx_v_out_c.memview)) __PYX_ERR(0, 654, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compute_c", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEm.compute_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5cPDEm_12compute_c(((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_v_self), __pyx_v_u, __pyx_v_vessel_index, __pyx_v_out_c);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_5cPDEm_12compute_c(struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("compute_c", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 654, __pyx_L1_error) }
  if (unlikely(!__pyx_v_out_c.memview)) { __Pyx_RaiseUnboundLocalError("out_c"); __PYX_ERR(0, 654, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_5cPDEm_compute_c(__pyx_v_self, __pyx_v_u, __pyx_v_vessel_index, __pyx_v_out_c, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __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("pylsewave.cynum.cPDEm.compute_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out_c, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":681
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cpdef double compute_c_i(self, double a, int index, int vessel_index):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_1compute_c_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_9pylsewave_5cynum_8cPDEsWat_compute_c_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  double __pyx_v_out;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __Pyx_RefNannySetupContext("compute_c_i", 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_compute_c_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_8cPDEsWat_1compute_c_i)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_10;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":696
 *         cdef double A0
 *         cdef double out
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *         out = sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[index]*sqrt(a/A0))
 *         return out
 */
  __pyx_t_11 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
  __pyx_t_12 = __pyx_v_index;
  __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_12)) ))), 2.0));
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);

  /* "pylsewave/cynum.pyx":697
 *         cdef double out
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out = sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[index]*sqrt(a/A0))             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
  __pyx_t_11 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
  __pyx_t_13 = __pyx_v_index;
  __pyx_v_out = sqrt((((0.5 / __pyx_v_self->__pyx_base._rho) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_13)) )))) * sqrt((__pyx_v_a / __pyx_v_A0))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);

  /* "pylsewave/cynum.pyx":698
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out = sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[index]*sqrt(a/A0))
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":681
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cpdef double compute_c_i(self, double a, int index, int vessel_index):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEsWat.compute_c_i", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_1compute_c_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_8cPDEsWat_compute_c_i[] = "\n        Method to compute local wave speed\n\n        .. math::\n             c(A) = \\sqrt{\\frac{1}{2 \\rho} f(R_0, k) \\sqrt{\\frac{A}{A_0}}}\n\n        :param a: the cross sectional area of the vessel\n        :type priority: double\n        :param int index: the number or the node to be calculated\n        :param vessel_index: the vessel unique Id\n        :return: double\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_1compute_c_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_a;
  int __pyx_v_index;
  int __pyx_v_vessel_index;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_c_i (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_index,&__pyx_n_s_vessel_index,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_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c_i", 1, 3, 3, 1); __PYX_ERR(0, 681, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c_i", 1, 3, 3, 2); __PYX_ERR(0, 681, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_c_i") < 0)) __PYX_ERR(0, 681, __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_a = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L3_error)
    __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compute_c_i", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 681, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEsWat.compute_c_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cPDEsWat_compute_c_i(((struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *)__pyx_v_self), __pyx_v_a, __pyx_v_index, __pyx_v_vessel_index);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cPDEsWat_compute_c_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("compute_c_i", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_9pylsewave_5cynum_8cPDEsWat_compute_c_i(__pyx_v_self, __pyx_v_a, __pyx_v_index, __pyx_v_vessel_index, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __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("pylsewave.cynum.cPDEsWat.compute_c_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":704
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cpdef void compute_c(self, double[:, ::1] u, int vessel_index, double[::1] out_c):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_3compute_c(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_8cPDEsWat_compute_c(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_siz;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  __Pyx_RefNannySetupContext("compute_c", 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_compute_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_8cPDEsWat_3compute_c)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_out_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 704, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":720
 *         cdef double A0
 *         cdef Py_ssize_t i, siz
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":721
 *         cdef Py_ssize_t i, siz
 *         siz = u.shape[1]
 *         for i in range(siz):             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_c[i] = sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[i]*sqrt(u[0, i]/A0))
 */
  __pyx_t_8 = __pyx_v_siz;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_8; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "pylsewave/cynum.pyx":722
 *         siz = u.shape[1]
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *             out_c[i] = sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[i]*sqrt(u[0, i]/A0))
 * 
 */
    __pyx_t_11 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
    __pyx_t_12 = __pyx_v_i;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_12)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);

    /* "pylsewave/cynum.pyx":723
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_c[i] = sqrt((0.5/self._rho)*self.vessels[vessel_index].f_r0[i]*sqrt(u[0, i]/A0))             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
    __pyx_t_11 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_14 = 0;
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_16 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_c.data) + __pyx_t_16)) )) = sqrt((((0.5 / __pyx_v_self->__pyx_base._rho) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_13)) )))) * sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_14 * __pyx_v_u.strides[0]) )) + __pyx_t_15)) ))) / __pyx_v_A0))));
    __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  }

  /* "pylsewave/cynum.pyx":704
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cpdef void compute_c(self, double[:, ::1] u, int vessel_index, double[::1] out_c):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEsWat.compute_c", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_3compute_c(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_8cPDEsWat_2compute_c[] = "\n        Method to compute local wave speed\n\n        .. math::\n             c(A) = \\sqrt{\\frac{1}{2 \\rho} f(R_0, k) \\sqrt{\\frac{A}{A_0}}}\n\n        :param u: the solution vector\n        :type priority: ndarray[ndim=2, type=double]\n        :param int index: the number or the node to be calculated\n        :param vessel_index: the vessel unique Id\n        :param out_c: the calculated wave speed vector\n        :type priority: ndarray[ndim=1, type=double]\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_3compute_c(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out_c = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_c (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_vessel_index,&__pyx_n_s_out_c,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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c", 1, 3, 3, 1); __PYX_ERR(0, 704, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c", 1, 3, 3, 2); __PYX_ERR(0, 704, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_c") < 0)) __PYX_ERR(0, 704, __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_u = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 704, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 704, __pyx_L3_error)
    __pyx_v_out_c = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2]); if (unlikely(!__pyx_v_out_c.memview)) __PYX_ERR(0, 704, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compute_c", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 704, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEsWat.compute_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cPDEsWat_2compute_c(((struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *)__pyx_v_self), __pyx_v_u, __pyx_v_vessel_index, __pyx_v_out_c);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cPDEsWat_2compute_c(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("compute_c", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_8cPDEsWat_compute_c(__pyx_v_self, __pyx_v_u, __pyx_v_vessel_index, __pyx_v_out_c, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __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("pylsewave.cynum.cPDEsWat.compute_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out_c, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":729
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef double pressure_i(self, double a, int index, int vessel_index) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute pressure from pressure-area relationship
 */

static double __pyx_f_9pylsewave_5cynum_8cPDEsWat_pressure_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index) {
  double __pyx_v_A0;
  double __pyx_v_out;
  double __pyx_r;
  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;

  /* "pylsewave/cynum.pyx":744
 *         cdef double A0
 *         cdef double out
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *         out = self.vessels[vessel_index].f_r0[index]*(sqrt(a / A0) - 1.0)
 *         return out
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_1, 0);
  __pyx_t_2 = __pyx_v_index;
  __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_1.data) + __pyx_t_2)) ))), 2.0));
  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 0);

  /* "pylsewave/cynum.pyx":745
 *         cdef double out
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out = self.vessels[vessel_index].f_r0[index]*(sqrt(a / A0) - 1.0)             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_1, 0);
  __pyx_t_3 = __pyx_v_index;
  __pyx_v_out = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_1.data) + __pyx_t_3)) ))) * (sqrt((__pyx_v_a / __pyx_v_A0)) - 1.0));
  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 0);

  /* "pylsewave/cynum.pyx":746
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out = self.vessels[vessel_index].f_r0[index]*(sqrt(a / A0) - 1.0)
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":729
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef double pressure_i(self, double a, int index, int vessel_index) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute pressure from pressure-area relationship
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":752
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cdef void pressure(self, double[:, ::1] u, int vessel_index, double[::1] out_p):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute pressure from pressure-area relationship
 */

static void __pyx_f_9pylsewave_5cynum_8cPDEsWat_pressure(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_p) {
  double __pyx_v_A0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_siz;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("pressure", 0);

  /* "pylsewave/cynum.pyx":767
 *         cdef double A0
 *         cdef Py_ssize_t i, siz
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":768
 *         cdef Py_ssize_t i, siz
 *         siz = u.shape[1]
 *         for i in range(siz):             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_p[i] = self.vessels[vessel_index].f_r0[i]*(sqrt(u[0, i] / A0) - 1.0)
 */
  __pyx_t_1 = __pyx_v_siz;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":769
 *         siz = u.shape[1]
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *             out_p[i] = self.vessels[vessel_index].f_r0[i]*(sqrt(u[0, i] / A0) - 1.0)
 * 
 */
    __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_3, 1);
    __pyx_t_4 = __pyx_v_i;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_4)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);

    /* "pylsewave/cynum.pyx":770
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_p[i] = self.vessels[vessel_index].f_r0[i]*(sqrt(u[0, i] / A0) - 1.0)             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
    __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_3, 1);
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_6 = 0;
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_8 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_p.data) + __pyx_t_8)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_5)) ))) * (sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_6 * __pyx_v_u.strides[0]) )) + __pyx_t_7)) ))) / __pyx_v_A0)) - 1.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
  }

  /* "pylsewave/cynum.pyx":752
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cdef void pressure(self, double[:, ::1] u, int vessel_index, double[::1] out_p):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute pressure from pressure-area relationship
 */

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

/* "pylsewave/cynum.pyx":776
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int flux(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_F) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

static int __pyx_f_9pylsewave_5cynum_8cPDEsWat_flux(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_F) {
  double __pyx_v_A0;
  double __pyx_v_f_r0;
  __pyx_t_5numpy_intp_t __pyx_v_siz;
  __pyx_t_5numpy_intp_t __pyx_v_i;
  int __pyx_r;
  __pyx_t_5numpy_intp_t __pyx_t_1;
  __pyx_t_5numpy_intp_t __pyx_t_2;
  __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;

  /* "pylsewave/cynum.pyx":791
 *         cdef np.intp_t siz, i
 * 
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         if x == 0:
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":793
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":794
 * 
 *         if x == 0:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":795
 *         if x == 0:
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 out_F[0, i] = u[1, i]
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_4 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_4)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":796
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]             # <<<<<<<<<<<<<<
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_5 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_5)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":797
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 out_F[0, i] = u[1, i]             # <<<<<<<<<<<<<<
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 *         elif x == 1:
 */
      __pyx_t_6 = 1;
      __pyx_t_7 = __pyx_v_i;
      __pyx_t_8 = 0;
      __pyx_t_9 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_8 * __pyx_v_out_F.strides[0]) )) + __pyx_t_9)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_6 * __pyx_v_u.strides[0]) )) + __pyx_t_7)) )));

      /* "pylsewave/cynum.pyx":798
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             for i in range(siz):
 */
      __pyx_t_10 = 1;
      __pyx_t_11 = __pyx_v_i;
      __pyx_t_12 = 1;
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_14 = 0;
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_16 = 0;
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = 1;
      __pyx_t_19 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_18 * __pyx_v_out_F.strides[0]) )) + __pyx_t_19)) )) = ((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_10 * __pyx_v_u.strides[0]) )) + __pyx_t_11)) ))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_12 * __pyx_v_u.strides[0]) )) + __pyx_t_13)) )))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_14 * __pyx_v_u.strides[0]) )) + __pyx_t_15)) )))) + ((__pyx_v_f_r0 / (3.0 * __pyx_v_self->__pyx_base._rho)) * (pow((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_16 * __pyx_v_u.strides[0]) )) + __pyx_t_17)) ))), (3.0 / 2.)) * pow(__pyx_v_A0, (-1.0 / 2.)))));
    }

    /* "pylsewave/cynum.pyx":793
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":799
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 */
    case 1:

    /* "pylsewave/cynum.pyx":800
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 *         elif x == 1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":801
 *         elif x == 1:
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 out_F[0, i] = u[1, i]
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0p;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_20 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_20)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":802
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]             # <<<<<<<<<<<<<<
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_21 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_21)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":803
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 out_F[0, i] = u[1, i]             # <<<<<<<<<<<<<<
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 *         elif x == -1:
 */
      __pyx_t_22 = 1;
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_24 = 0;
      __pyx_t_25 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_24 * __pyx_v_out_F.strides[0]) )) + __pyx_t_25)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_22 * __pyx_v_u.strides[0]) )) + __pyx_t_23)) )));

      /* "pylsewave/cynum.pyx":804
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))             # <<<<<<<<<<<<<<
 *         elif x == -1:
 *             for i in range(siz):
 */
      __pyx_t_26 = 1;
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = 1;
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_30 = 0;
      __pyx_t_31 = __pyx_v_i;
      __pyx_t_32 = 0;
      __pyx_t_33 = __pyx_v_i;
      __pyx_t_34 = 1;
      __pyx_t_35 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_34 * __pyx_v_out_F.strides[0]) )) + __pyx_t_35)) )) = ((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_26 * __pyx_v_u.strides[0]) )) + __pyx_t_27)) ))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_28 * __pyx_v_u.strides[0]) )) + __pyx_t_29)) )))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_30 * __pyx_v_u.strides[0]) )) + __pyx_t_31)) )))) + ((__pyx_v_f_r0 / (3.0 * __pyx_v_self->__pyx_base._rho)) * (pow((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_32 * __pyx_v_u.strides[0]) )) + __pyx_t_33)) ))), (3.0 / 2.)) * pow(__pyx_v_A0, (-1.0 / 2.)))));
    }

    /* "pylsewave/cynum.pyx":799
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":805
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 */
    case -1L:

    /* "pylsewave/cynum.pyx":806
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 *         elif x == -1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":807
 *         elif x == -1:
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 out_F[0, i] = u[1, i]
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0m;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_36 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_36)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":808
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]             # <<<<<<<<<<<<<<
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_37 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_37)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":809
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 out_F[0, i] = u[1, i]             # <<<<<<<<<<<<<<
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 * 
 */
      __pyx_t_38 = 1;
      __pyx_t_39 = __pyx_v_i;
      __pyx_t_40 = 0;
      __pyx_t_41 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_40 * __pyx_v_out_F.strides[0]) )) + __pyx_t_41)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_38 * __pyx_v_u.strides[0]) )) + __pyx_t_39)) )));

      /* "pylsewave/cynum.pyx":810
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
      __pyx_t_42 = 1;
      __pyx_t_43 = __pyx_v_i;
      __pyx_t_44 = 1;
      __pyx_t_45 = __pyx_v_i;
      __pyx_t_46 = 0;
      __pyx_t_47 = __pyx_v_i;
      __pyx_t_48 = 0;
      __pyx_t_49 = __pyx_v_i;
      __pyx_t_50 = 1;
      __pyx_t_51 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_50 * __pyx_v_out_F.strides[0]) )) + __pyx_t_51)) )) = ((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_42 * __pyx_v_u.strides[0]) )) + __pyx_t_43)) ))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_44 * __pyx_v_u.strides[0]) )) + __pyx_t_45)) )))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_46 * __pyx_v_u.strides[0]) )) + __pyx_t_47)) )))) + ((__pyx_v_f_r0 / (3.0 * __pyx_v_self->__pyx_base._rho)) * (pow((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_48 * __pyx_v_u.strides[0]) )) + __pyx_t_49)) ))), (3.0 / 2.)) * pow(__pyx_v_A0, (-1.0 / 2.)))));
    }

    /* "pylsewave/cynum.pyx":805
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":812
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + (f_r0/(3.0*self._rho))*((u[0, i]**(3/2.))*(A0**(-1/2.)))
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":776
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int flux(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_F) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":818
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void flux_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_f):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_5flux_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_8cPDEsWat_flux_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  double __pyx_v_f_r0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  __Pyx_RefNannySetupContext("flux_i", 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_flux_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_8cPDEsWat_5flux_i)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_out_f, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":833
 *         cdef np.intp_t siz, i
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":834
 * 
 *         if x == 0:
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             out_f[0] = u[1]
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_13 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_13)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":835
 *         if x == 0:
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]             # <<<<<<<<<<<<<<
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_14 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_14)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":836
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             out_f[0] = u[1]             # <<<<<<<<<<<<<<
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 *         elif x == 1:
 */
    __pyx_t_15 = 1;
    __pyx_t_16 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_16)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_15)) )));

    /* "pylsewave/cynum.pyx":837
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 */
    __pyx_t_17 = 1;
    __pyx_t_18 = 1;
    __pyx_t_19 = 0;
    __pyx_t_20 = 0;
    __pyx_t_21 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_21)) )) = ((((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_17)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_18)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_19)) )))) + ((__pyx_v_f_r0 / (3.0 * __pyx_v_self->__pyx_base._rho)) * (pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_20)) ))), (3.0 / 2.)) * pow(__pyx_v_A0, (-1.0 / 2.)))));

    /* "pylsewave/cynum.pyx":833
 *         cdef np.intp_t siz, i
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 */
    break;

    /* "pylsewave/cynum.pyx":838
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 */
    case 1:

    /* "pylsewave/cynum.pyx":839
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 *         elif x == 1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             out_f[0] = u[1]
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0p;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_22 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_22)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":840
 *         elif x == 1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]             # <<<<<<<<<<<<<<
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_23 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_23)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":841
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             out_f[0] = u[1]             # <<<<<<<<<<<<<<
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 *         elif x == -1:
 */
    __pyx_t_24 = 1;
    __pyx_t_25 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_25)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_24)) )));

    /* "pylsewave/cynum.pyx":842
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))             # <<<<<<<<<<<<<<
 *         elif x == -1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 */
    __pyx_t_26 = 1;
    __pyx_t_27 = 1;
    __pyx_t_28 = 0;
    __pyx_t_29 = 0;
    __pyx_t_30 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_30)) )) = ((((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_26)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_27)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_28)) )))) + ((__pyx_v_f_r0 / (3.0 * __pyx_v_self->__pyx_base._rho)) * (pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_29)) ))), (3.0 / 2.)) * pow(__pyx_v_A0, (-1.0 / 2.)))));

    /* "pylsewave/cynum.pyx":838
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 */
    break;

    /* "pylsewave/cynum.pyx":843
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 */
    case -1L:

    /* "pylsewave/cynum.pyx":844
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 *         elif x == -1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             out_f[0] = u[1]
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0m;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_31 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_31)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":845
 *         elif x == -1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]             # <<<<<<<<<<<<<<
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_32 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_32)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":846
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             out_f[0] = u[1]             # <<<<<<<<<<<<<<
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 * 
 */
    __pyx_t_33 = 1;
    __pyx_t_34 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_34)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_33)) )));

    /* "pylsewave/cynum.pyx":847
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
    __pyx_t_35 = 1;
    __pyx_t_36 = 1;
    __pyx_t_37 = 0;
    __pyx_t_38 = 0;
    __pyx_t_39 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_39)) )) = ((((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_35)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_36)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_37)) )))) + ((__pyx_v_f_r0 / (3.0 * __pyx_v_self->__pyx_base._rho)) * (pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_38)) ))), (3.0 / 2.)) * pow(__pyx_v_A0, (-1.0 / 2.)))));

    /* "pylsewave/cynum.pyx":843
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + (f_r0/(3.0*self._rho))*((u[0]**(3/2.))*(A0**(-1/2.)))
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":818
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void flux_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_f):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEsWat.flux_i", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_5flux_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_8cPDEsWat_4flux_i[] = "\n        Method to calculate the Flux term.\n\n        :param u: the solution vector u\n        :type priority: ndarray[ndim=1, dtype=double]\n        :param x: the spatial point index\n        :type priority: int\n        :param int vessel_index: the unique vessel Id\n        :param ndarray[ndim=1, dtype=double] out_F: the flux vector\n        :return: None\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_5flux_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_x;
  int __pyx_v_index;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out_f = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flux_i (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_x,&__pyx_n_s_index,&__pyx_n_s_vessel_index,&__pyx_n_s_out_f,0};
    PyObject* values[5] = {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  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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 1); __PYX_ERR(0, 818, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 2); __PYX_ERR(0, 818, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 3); __PYX_ERR(0, 818, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_f)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 4); __PYX_ERR(0, 818, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flux_i") < 0)) __PYX_ERR(0, 818, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
    }
    __pyx_v_u = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 818, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error)
    __pyx_v_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error)
    __pyx_v_out_f = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[4]); if (unlikely(!__pyx_v_out_f.memview)) __PYX_ERR(0, 818, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEsWat.flux_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cPDEsWat_4flux_i(((struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *)__pyx_v_self), __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_f);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cPDEsWat_4flux_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("flux_i", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_8cPDEsWat_flux_i(__pyx_v_self, __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_f, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __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("pylsewave.cynum.cPDEsWat.flux_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out_f, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":853
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int source(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_S) nogil:             # <<<<<<<<<<<<<<
 *         """
 *          Method to calculate the Source term.
 */

static int __pyx_f_9pylsewave_5cynum_8cPDEsWat_source(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_S) {
  double __pyx_v_A0;
  double __pyx_v_R;
  double __pyx_v_f_r0;
  double __pyx_v_df_dr0;
  double __pyx_v_df_dx;
  __pyx_t_5numpy_intp_t __pyx_v_siz;
  __pyx_t_5numpy_intp_t __pyx_v_i;
  double __pyx_v__nu;
  int __pyx_r;
  __pyx_t_5numpy_intp_t __pyx_t_1;
  __pyx_t_5numpy_intp_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;

  /* "pylsewave/cynum.pyx":866
 *         cdef double A0, R, f_r0, df_dr0, df_dx
 *         cdef np.intp_t siz, i
 *         cdef double _nu = ((self._mu)/self._rho)             # <<<<<<<<<<<<<<
 *         siz = u.shape[1]
 * 
 */
  __pyx_v__nu = (__pyx_v_self->__pyx_base._mu / __pyx_v_self->__pyx_base._rho);

  /* "pylsewave/cynum.pyx":867
 *         cdef np.intp_t siz, i
 *         cdef double _nu = ((self._mu)/self._rho)
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         if x == 0:
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":869
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":870
 * 
 *         if x == 0:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":871
 *         if x == 0:
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 */
      __pyx_t_3 = 0;
      __pyx_t_4 = __pyx_v_i;
      __pyx_v_R = sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_3 * __pyx_v_u.strides[0]) )) + __pyx_t_4)) ))) / M_PI));

      /* "pylsewave/cynum.pyx":872
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_6 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_6)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":873
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]             # <<<<<<<<<<<<<<
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_7 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_7)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":874
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]             # <<<<<<<<<<<<<<
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_8 = __pyx_v_i;
      __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_8)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":875
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 *                 df_dx = self.vessels[vessel_index].df_dx[i]             # <<<<<<<<<<<<<<
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_9 = __pyx_v_i;
      __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_9)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":876
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0             # <<<<<<<<<<<<<<
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 */
      __pyx_t_10 = 0;
      __pyx_t_11 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_10 * __pyx_v_out_S.strides[0]) )) + __pyx_t_11)) )) = 0.0;

      /* "pylsewave/cynum.pyx":877
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 *         elif x == 1:
 */
      __pyx_t_12 = 1;
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_14 = 0;
      __pyx_t_15 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":878
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             for i in range(siz):
 */
      __pyx_t_16 = 0;
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = 0;
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_20 = 0;
      __pyx_t_21 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":877
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 *         elif x == 1:
 */
      __pyx_t_22 = 1;
      __pyx_t_23 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_22 * __pyx_v_out_S.strides[0]) )) + __pyx_t_23)) )) = ((((((-2. * M_PI) * __pyx_v__nu) * __pyx_v_R) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_12 * __pyx_v_u.strides[0]) )) + __pyx_t_13)) )))) / (__pyx_v_self->__pyx_base.delta * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_14 * __pyx_v_u.strides[0]) )) + __pyx_t_15)) ))))) + (((1. / __pyx_v_self->__pyx_base._rho) * (((((2.0 * sqrt(M_PI)) * __pyx_v_f_r0) * pow((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_16 * __pyx_v_u.strides[0]) )) + __pyx_t_17)) ))), (3.0 / 2.))) / (3. * __pyx_v_A0)) - (((((2.0 / 3.) * pow((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_18 * __pyx_v_u.strides[0]) )) + __pyx_t_19)) ))), (3.0 / 2.))) * pow(__pyx_v_A0, (-1.0 / 2.))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_20 * __pyx_v_u.strides[0]) )) + __pyx_t_21)) )))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));
    }

    /* "pylsewave/cynum.pyx":869
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    break;

    /* "pylsewave/cynum.pyx":879
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    case 1:

    /* "pylsewave/cynum.pyx":880
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 *         elif x == 1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":881
 *         elif x == 1:
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 */
      __pyx_t_24 = 0;
      __pyx_t_25 = __pyx_v_i;
      __pyx_v_R = sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_24 * __pyx_v_u.strides[0]) )) + __pyx_t_25)) ))) / M_PI));

      /* "pylsewave/cynum.pyx":882
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0p;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_26 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_26)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":883
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]             # <<<<<<<<<<<<<<
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_27 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_27)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":884
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]             # <<<<<<<<<<<<<<
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_28 = __pyx_v_i;
      __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_28)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":885
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]             # <<<<<<<<<<<<<<
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_29 = __pyx_v_i;
      __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_29)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":886
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0             # <<<<<<<<<<<<<<
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 */
      __pyx_t_30 = 0;
      __pyx_t_31 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_30 * __pyx_v_out_S.strides[0]) )) + __pyx_t_31)) )) = 0.0;

      /* "pylsewave/cynum.pyx":887
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 *         elif x == -1:
 */
      __pyx_t_32 = 1;
      __pyx_t_33 = __pyx_v_i;
      __pyx_t_34 = 0;
      __pyx_t_35 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":888
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 *         elif x == -1:
 *             for i in range(siz):
 */
      __pyx_t_36 = 0;
      __pyx_t_37 = __pyx_v_i;
      __pyx_t_38 = 0;
      __pyx_t_39 = __pyx_v_i;
      __pyx_t_40 = 0;
      __pyx_t_41 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":887
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 *         elif x == -1:
 */
      __pyx_t_42 = 1;
      __pyx_t_43 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_42 * __pyx_v_out_S.strides[0]) )) + __pyx_t_43)) )) = ((((((-2. * M_PI) * __pyx_v__nu) * __pyx_v_R) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_32 * __pyx_v_u.strides[0]) )) + __pyx_t_33)) )))) / (__pyx_v_self->__pyx_base.delta * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_34 * __pyx_v_u.strides[0]) )) + __pyx_t_35)) ))))) + (((1. / __pyx_v_self->__pyx_base._rho) * (((((2.0 * sqrt(M_PI)) * __pyx_v_f_r0) * pow((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_36 * __pyx_v_u.strides[0]) )) + __pyx_t_37)) ))), (3.0 / 2.))) / (3. * __pyx_v_A0)) - (((((2.0 / 3.) * pow((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_38 * __pyx_v_u.strides[0]) )) + __pyx_t_39)) ))), (3.0 / 2.))) * pow(__pyx_v_A0, (-1.0 / 2.))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_40 * __pyx_v_u.strides[0]) )) + __pyx_t_41)) )))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));
    }

    /* "pylsewave/cynum.pyx":879
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    break;

    /* "pylsewave/cynum.pyx":889
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    case -1L:

    /* "pylsewave/cynum.pyx":890
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 *         elif x == -1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":891
 *         elif x == -1:
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 */
      __pyx_t_44 = 0;
      __pyx_t_45 = __pyx_v_i;
      __pyx_v_R = sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_44 * __pyx_v_u.strides[0]) )) + __pyx_t_45)) ))) / M_PI));

      /* "pylsewave/cynum.pyx":892
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0m;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_46 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_46)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":893
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]             # <<<<<<<<<<<<<<
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_47 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_47)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":894
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]             # <<<<<<<<<<<<<<
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_48 = __pyx_v_i;
      __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_48)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":895
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]             # <<<<<<<<<<<<<<
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_49 = __pyx_v_i;
      __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_49)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":896
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0             # <<<<<<<<<<<<<<
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 */
      __pyx_t_50 = 0;
      __pyx_t_51 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_50 * __pyx_v_out_S.strides[0]) )) + __pyx_t_51)) )) = 0.0;

      /* "pylsewave/cynum.pyx":897
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 * 
 */
      __pyx_t_52 = 1;
      __pyx_t_53 = __pyx_v_i;
      __pyx_t_54 = 0;
      __pyx_t_55 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":898
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
      __pyx_t_56 = 0;
      __pyx_t_57 = __pyx_v_i;
      __pyx_t_58 = 0;
      __pyx_t_59 = __pyx_v_i;
      __pyx_t_60 = 0;
      __pyx_t_61 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":897
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 * 
 */
      __pyx_t_62 = 1;
      __pyx_t_63 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_62 * __pyx_v_out_S.strides[0]) )) + __pyx_t_63)) )) = ((((((-2. * M_PI) * __pyx_v__nu) * __pyx_v_R) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_52 * __pyx_v_u.strides[0]) )) + __pyx_t_53)) )))) / (__pyx_v_self->__pyx_base.delta * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_54 * __pyx_v_u.strides[0]) )) + __pyx_t_55)) ))))) + (((1. / __pyx_v_self->__pyx_base._rho) * (((((2.0 * sqrt(M_PI)) * __pyx_v_f_r0) * pow((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_56 * __pyx_v_u.strides[0]) )) + __pyx_t_57)) ))), (3.0 / 2.))) / (3. * __pyx_v_A0)) - (((((2.0 / 3.) * pow((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_58 * __pyx_v_u.strides[0]) )) + __pyx_t_59)) ))), (3.0 / 2.))) * pow(__pyx_v_A0, (-1.0 / 2.))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_60 * __pyx_v_u.strides[0]) )) + __pyx_t_61)) )))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));
    }

    /* "pylsewave/cynum.pyx":889
 *                 out_S[1, i] = (((-2.*M_PI*_nu*R*u[1, i]) / (self.delta*u[0, i])) +
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":900
 *                                (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0, i]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0, i]**(3/2.))*A0**(-1/2.)) - u[0, i])*df_dr0)*df_dx)
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":853
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int source(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_S) nogil:             # <<<<<<<<<<<<<<
 *         """
 *          Method to calculate the Source term.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":906
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void source_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_s):             # <<<<<<<<<<<<<<
 *         """
 *          Method to calculate the Source term.
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_7source_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_8cPDEsWat_source_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  double __pyx_v_R;
  double __pyx_v_f_r0;
  double __pyx_v_df_dr0;
  double __pyx_v_df_dx;
  double __pyx_v__nu;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  __Pyx_RefNannySetupContext("source_i", 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_source_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_8cPDEsWat_7source_i)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_out_s, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":918
 *         """
 *         cdef double A0, R, f_r0, df_dr0, df_dx
 *         cdef double _nu = ((self._mu)/self._rho)             # <<<<<<<<<<<<<<
 * 
 *         if x == 0:
 */
  __pyx_v__nu = (__pyx_v_self->__pyx_base._mu / __pyx_v_self->__pyx_base._rho);

  /* "pylsewave/cynum.pyx":920
 *         cdef double _nu = ((self._mu)/self._rho)
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":921
 * 
 *         if x == 0:
 *             R = sqrt(u[0] / M_PI)             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 */
    __pyx_t_12 = 0;
    __pyx_v_R = sqrt(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_12)) ))) / M_PI));

    /* "pylsewave/cynum.pyx":922
 *         if x == 0:
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_14 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_14)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":923
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]             # <<<<<<<<<<<<<<
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_15 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_15)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":924
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]             # <<<<<<<<<<<<<<
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_16 = __pyx_v_index;
    __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_16)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":925
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 *             df_dx = self.vessels[vessel_index].df_dx[index]             # <<<<<<<<<<<<<<
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_17 = __pyx_v_index;
    __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_17)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":926
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0             # <<<<<<<<<<<<<<
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 */
    __pyx_t_18 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_18)) )) = 0.0;

    /* "pylsewave/cynum.pyx":927
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 *         elif x == 1:
 */
    __pyx_t_19 = 1;
    __pyx_t_20 = 0;

    /* "pylsewave/cynum.pyx":928
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             R = sqrt(u[0] / M_PI)
 */
    __pyx_t_21 = 0;
    __pyx_t_22 = 0;
    __pyx_t_23 = 0;

    /* "pylsewave/cynum.pyx":927
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 *         elif x == 1:
 */
    __pyx_t_24 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_24)) )) = ((((((-2. * M_PI) * __pyx_v__nu) * __pyx_v_R) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_19)) )))) / (__pyx_v_self->__pyx_base.delta * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_20)) ))))) + (((1. / __pyx_v_self->__pyx_base._rho) * (((((2.0 * sqrt(M_PI)) * __pyx_v_f_r0) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_21)) ))), (3.0 / 2.))) / (3. * __pyx_v_A0)) - (((((2.0 / 3.) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_22)) ))), (3.0 / 2.))) * pow(__pyx_v_A0, (-1.0 / 2.))) - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_23)) )))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));

    /* "pylsewave/cynum.pyx":920
 *         cdef double _nu = ((self._mu)/self._rho)
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":929
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 */
    case 1:

    /* "pylsewave/cynum.pyx":930
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 *         elif x == 1:
 *             R = sqrt(u[0] / M_PI)             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 */
    __pyx_t_25 = 0;
    __pyx_v_R = sqrt(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_25)) ))) / M_PI));

    /* "pylsewave/cynum.pyx":931
 *         elif x == 1:
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0p;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_26 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_26)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":932
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]             # <<<<<<<<<<<<<<
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_27 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_27)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":933
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]             # <<<<<<<<<<<<<<
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_28 = __pyx_v_index;
    __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_28)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":934
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]             # <<<<<<<<<<<<<<
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_29 = __pyx_v_index;
    __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_29)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":935
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0             # <<<<<<<<<<<<<<
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 */
    __pyx_t_30 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_30)) )) = 0.0;

    /* "pylsewave/cynum.pyx":936
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 * 
 */
    __pyx_t_31 = 1;
    __pyx_t_32 = 0;

    /* "pylsewave/cynum.pyx":937
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 * 
 *         elif x == -1:
 */
    __pyx_t_33 = 0;
    __pyx_t_34 = 0;
    __pyx_t_35 = 0;

    /* "pylsewave/cynum.pyx":936
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 * 
 */
    __pyx_t_36 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_36)) )) = ((((((-2. * M_PI) * __pyx_v__nu) * __pyx_v_R) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_31)) )))) / (__pyx_v_self->__pyx_base.delta * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_32)) ))))) + (((1. / __pyx_v_self->__pyx_base._rho) * (((((2.0 * sqrt(M_PI)) * __pyx_v_f_r0) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_33)) ))), (3.0 / 2.))) / (3. * __pyx_v_A0)) - (((((2.0 / 3.) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_34)) ))), (3.0 / 2.))) * pow(__pyx_v_A0, (-1.0 / 2.))) - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_35)) )))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));

    /* "pylsewave/cynum.pyx":929
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":939
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 * 
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 */
    case -1L:

    /* "pylsewave/cynum.pyx":940
 * 
 *         elif x == -1:
 *             R = sqrt(u[0] / M_PI)             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 */
    __pyx_t_37 = 0;
    __pyx_v_R = sqrt(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_37)) ))) / M_PI));

    /* "pylsewave/cynum.pyx":941
 *         elif x == -1:
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0m;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_38 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_38)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":942
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]             # <<<<<<<<<<<<<<
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_39 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_39)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":943
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]             # <<<<<<<<<<<<<<
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_40 = __pyx_v_index;
    __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_40)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":944
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]             # <<<<<<<<<<<<<<
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_41 = __pyx_v_index;
    __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_41)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":945
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0             # <<<<<<<<<<<<<<
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 */
    __pyx_t_42 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_42)) )) = 0.0;

    /* "pylsewave/cynum.pyx":946
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 * 
 */
    __pyx_t_43 = 1;
    __pyx_t_44 = 0;

    /* "pylsewave/cynum.pyx":947
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_45 = 0;
    __pyx_t_46 = 0;
    __pyx_t_47 = 0;

    /* "pylsewave/cynum.pyx":946
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*_nu*R*u[1]) / (self.delta*u[0])) +             # <<<<<<<<<<<<<<
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 * 
 */
    __pyx_t_48 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_48)) )) = ((((((-2. * M_PI) * __pyx_v__nu) * __pyx_v_R) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_43)) )))) / (__pyx_v_self->__pyx_base.delta * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_44)) ))))) + (((1. / __pyx_v_self->__pyx_base._rho) * (((((2.0 * sqrt(M_PI)) * __pyx_v_f_r0) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_45)) ))), (3.0 / 2.))) / (3. * __pyx_v_A0)) - (((((2.0 / 3.) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_46)) ))), (3.0 / 2.))) * pow(__pyx_v_A0, (-1.0 / 2.))) - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_47)) )))) * __pyx_v_df_dr0))) * __pyx_v_df_dx));

    /* "pylsewave/cynum.pyx":939
 *                         (1./self._rho)*(((2*sqrt(M_PI)*f_r0*u[0]**(3/2.))/(3.*A0)) - (((2/3.)*(u[0]**(3/2.))*A0**(-1/2.)) - u[0])*df_dr0)*df_dx)
 * 
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":906
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void source_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_s):             # <<<<<<<<<<<<<<
 *         """
 *          Method to calculate the Source term.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEsWat.source_i", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_7source_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_8cPDEsWat_6source_i[] = "\n         Method to calculate the Source term.\n\n        :param u: the solution vector u\n        :type priority: ndarray[ndim=1, dtype=double]\n        :param x: the spatial point index\n        :type priority: int\n        :param int vessel_index: the unique vessel Id\n        :param ndarray[ndim=1, dtype=double] out_S: the source vector \n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_8cPDEsWat_7source_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_x;
  int __pyx_v_index;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out_s = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("source_i (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_x,&__pyx_n_s_index,&__pyx_n_s_vessel_index,&__pyx_n_s_out_s,0};
    PyObject* values[5] = {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  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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 1); __PYX_ERR(0, 906, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 2); __PYX_ERR(0, 906, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 3); __PYX_ERR(0, 906, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_s)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 4); __PYX_ERR(0, 906, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "source_i") < 0)) __PYX_ERR(0, 906, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
    }
    __pyx_v_u = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 906, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L3_error)
    __pyx_v_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L3_error)
    __pyx_v_out_s = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[4]); if (unlikely(!__pyx_v_out_s.memview)) __PYX_ERR(0, 906, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 906, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEsWat.source_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8cPDEsWat_6source_i(((struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *)__pyx_v_self), __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_s);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8cPDEsWat_6source_i(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("source_i", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_8cPDEsWat_source_i(__pyx_v_self, __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_s, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __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("pylsewave.cynum.cPDEsWat.source_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out_s, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":957
 *     ..note:: see Watanabe at al.
 *     """
 *     cpdef void set_vessels(self, vector[cvessel] &vectorV, int siz) except *:             # <<<<<<<<<<<<<<
 *         for i in range(siz):
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_1set_vessels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
void __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_set_vessels(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, CYTHON_UNUSED std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &__pyx_v_vectorV, int __pyx_v_siz, int __pyx_skip_dispatch) {
  int __pyx_v_i;
  __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;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("set_vessels", 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_set_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_1set_vessels)) {
      __pyx_t_3 = __pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel(__pyx_v_vectorV); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_siz); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":958
 *     """
 *     cpdef void set_vessels(self, vector[cvessel] &vectorV, int siz) except *:
 *         for i in range(siz):             # <<<<<<<<<<<<<<
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 */
  __pyx_t_9 = __pyx_v_siz;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "pylsewave/cynum.pyx":959
 *     cpdef void set_vessels(self, vector[cvessel] &vectorV, int siz) except *:
 *         for i in range(siz):
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0             # <<<<<<<<<<<<<<
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_r0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).r0, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).r0 = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":960
 *         for i in range(siz):
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0             # <<<<<<<<<<<<<<
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_f_r0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 960, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).f_r0, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).f_r0 = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":961
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)             # <<<<<<<<<<<<<<
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_interpolate_R0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).interpolate_R0p, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).interpolate_R0p = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":962
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)             # <<<<<<<<<<<<<<
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_interpolate_R0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 962, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).interpolate_R0m, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).interpolate_R0m = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":963
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph             # <<<<<<<<<<<<<<
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh
 *             self.vessels[i].df_dr0 = self.mesh.vessels[i].df_dr0
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_f_r0_ph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 963, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).f_r0_ph, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).f_r0_ph = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":964
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dr0 = self.mesh.vessels[i].df_dr0
 *             self.vessels[i].df_dx = self.mesh.vessels[i].df_dx
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_f_r0_mh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).f_r0_mh, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).f_r0_mh = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":965
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh
 *             self.vessels[i].df_dr0 = self.mesh.vessels[i].df_dr0             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dx = self.mesh.vessels[i].df_dx
 *             self.vessels[i].df_dr0_ph = self.mesh.vessels[i].df_dr0_ph
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dr0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 965, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dr0, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dr0 = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":966
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh
 *             self.vessels[i].df_dr0 = self.mesh.vessels[i].df_dr0
 *             self.vessels[i].df_dx = self.mesh.vessels[i].df_dx             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dr0_ph = self.mesh.vessels[i].df_dr0_ph
 *             self.vessels[i].df_dx_ph = self.mesh.vessels[i].df_dx_ph
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 966, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dx, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dx = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":967
 *             self.vessels[i].df_dr0 = self.mesh.vessels[i].df_dr0
 *             self.vessels[i].df_dx = self.mesh.vessels[i].df_dx
 *             self.vessels[i].df_dr0_ph = self.mesh.vessels[i].df_dr0_ph             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dx_ph = self.mesh.vessels[i].df_dx_ph
 *             self.vessels[i].df_dr0_mh = self.mesh.vessels[i].df_dr0_mh
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dr0_ph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 967, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dr0_ph, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dr0_ph = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":968
 *             self.vessels[i].df_dx = self.mesh.vessels[i].df_dx
 *             self.vessels[i].df_dr0_ph = self.mesh.vessels[i].df_dr0_ph
 *             self.vessels[i].df_dx_ph = self.mesh.vessels[i].df_dx_ph             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dr0_mh = self.mesh.vessels[i].df_dr0_mh
 *             self.vessels[i].df_dx_mh = self.mesh.vessels[i].df_dx_mh
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dx_ph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 968, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dx_ph, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dx_ph = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":969
 *             self.vessels[i].df_dr0_ph = self.mesh.vessels[i].df_dr0_ph
 *             self.vessels[i].df_dx_ph = self.mesh.vessels[i].df_dx_ph
 *             self.vessels[i].df_dr0_mh = self.mesh.vessels[i].df_dr0_mh             # <<<<<<<<<<<<<<
 *             self.vessels[i].df_dx_mh = self.mesh.vessels[i].df_dx_mh
 *             self.vessels[i].L = self.mesh.vessels[i].length
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dr0_mh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 969, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dr0_mh, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dr0_mh = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":970
 *             self.vessels[i].df_dx_ph = self.mesh.vessels[i].df_dx_ph
 *             self.vessels[i].df_dr0_mh = self.mesh.vessels[i].df_dr0_mh
 *             self.vessels[i].df_dx_mh = self.mesh.vessels[i].df_dx_mh             # <<<<<<<<<<<<<<
 *             self.vessels[i].L = self.mesh.vessels[i].length
 *             self.vessels[i].dx = self.mesh.vessels[i].dx
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_df_dx_mh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 970, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dx_mh, 0);
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).df_dx_mh = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;

    /* "pylsewave/cynum.pyx":971
 *             self.vessels[i].df_dr0_mh = self.mesh.vessels[i].df_dr0_mh
 *             self.vessels[i].df_dx_mh = self.mesh.vessels[i].df_dx_mh
 *             self.vessels[i].L = self.mesh.vessels[i].length             # <<<<<<<<<<<<<<
 *             self.vessels[i].dx = self.mesh.vessels[i].dx
 *             self.vessels[i].phi = self.mesh.vessels[i].phi
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 971, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).L = __pyx_t_12;

    /* "pylsewave/cynum.pyx":972
 *             self.vessels[i].df_dx_mh = self.mesh.vessels[i].df_dx_mh
 *             self.vessels[i].L = self.mesh.vessels[i].length
 *             self.vessels[i].dx = self.mesh.vessels[i].dx             # <<<<<<<<<<<<<<
 *             self.vessels[i].phi = self.mesh.vessels[i].phi
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).dx = __pyx_t_12;

    /* "pylsewave/cynum.pyx":973
 *             self.vessels[i].L = self.mesh.vessels[i].length
 *             self.vessels[i].dx = self.mesh.vessels[i].dx
 *             self.vessels[i].phi = self.mesh.vessels[i].phi             # <<<<<<<<<<<<<<
 * 
 *             if self.mesh.vessels[i].RLC is not None:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_phi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).phi = __pyx_t_12;

    /* "pylsewave/cynum.pyx":975
 *             self.vessels[i].phi = self.mesh.vessels[i].phi
 * 
 *             if self.mesh.vessels[i].RLC is not None:             # <<<<<<<<<<<<<<
 *                 self.vessels[i].RLC = np.array(list(self.mesh.vessels[i].RLC.values()), np.float)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RLC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_13 = (__pyx_t_1 != Py_None);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = (__pyx_t_13 != 0);
    if (__pyx_t_14) {

      /* "pylsewave/cynum.pyx":976
 * 
 *             if self.mesh.vessels[i].RLC is not None:
 *                 self.vessels[i].RLC = np.array(list(self.mesh.vessels[i].RLC.values()), np.float)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_RLC); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_8) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_t_8);
      __pyx_t_4 = 0;
      __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 976, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).RLC, 0);
      (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_i]).RLC = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":975
 *             self.vessels[i].phi = self.mesh.vessels[i].phi
 * 
 *             if self.mesh.vessels[i].RLC is not None:             # <<<<<<<<<<<<<<
 *                 self.vessels[i].RLC = np.array(list(self.mesh.vessels[i].RLC.values()), np.float)
 * 
 */
    }
  }

  /* "pylsewave/cynum.pyx":957
 *     ..note:: see Watanabe at al.
 *     """
 *     cpdef void set_vessels(self, vector[cvessel] &vectorV, int siz) except *:             # <<<<<<<<<<<<<<
 *         for i in range(siz):
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_AddTraceback("pylsewave.cynum.cPDEsWatVisco.set_vessels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_1set_vessels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_1set_vessels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_v_vectorV;
  int __pyx_v_siz;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_vessels (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vectorV,&__pyx_n_s_siz,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_vectorV)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_siz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_vessels", 1, 2, 2, 1); __PYX_ERR(0, 957, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_vessels") < 0)) __PYX_ERR(0, 957, __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_vectorV = __pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L3_error)
    __pyx_v_siz = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_siz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_vessels", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 957, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEsWatVisco.set_vessels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_13cPDEsWatVisco_set_vessels(((struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *)__pyx_v_self), __pyx_v_vectorV, __pyx_v_siz);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_13cPDEsWatVisco_set_vessels(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_v_vectorV, int __pyx_v_siz) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_vessels", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_set_vessels(__pyx_v_self, __pyx_v_vectorV, __pyx_v_siz, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __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("pylsewave.cynum.cPDEsWatVisco.set_vessels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

void __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_set_vessels__pyx_wrap_1(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, CYTHON_UNUSED std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &__pyx_v_vectorV, int __pyx_v_siz, int __pyx_skip_dispatch) {
  __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_set_vessels(__pyx_v_self, __pyx_v_vectorV, __pyx_v_siz, __pyx_skip_dispatch);
}

/* "pylsewave/cynum.pyx":983
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void pressure_visco(self, double[:, ::1] u, int vessel_index,             # <<<<<<<<<<<<<<
 *      double[::1] out_p):
 *         """
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_3pressure_visco(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_pressure_visco(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_p, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_siz;
  CYTHON_UNUSED int __pyx_v_res;
  __Pyx_memviewslice __pyx_v_dqdx = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_C_v = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __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;
  __Pyx_RefNannySetupContext("pressure_visco", 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_pressure_visco); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_3pressure_visco)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_out_p, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":999
 *         cdef Py_ssize_t i, siz
 *         cdef int res
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 *         cdef double[::1] dqdx = np.zeros(siz, np.float)
 *         cdef double[::1] C_v = np.zeros(siz, np.float)
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":1000
 *         cdef int res
 *         siz = u.shape[1]
 *         cdef double[::1] dqdx = np.zeros(siz, np.float)             # <<<<<<<<<<<<<<
 *         cdef double[::1] C_v = np.zeros(siz, np.float)
 *         # print(np.asarray(dqdx))
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_siz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_9) {
    __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dqdx = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "pylsewave/cynum.pyx":1001
 *         siz = u.shape[1]
 *         cdef double[::1] dqdx = np.zeros(siz, np.float)
 *         cdef double[::1] C_v = np.zeros(siz, np.float)             # <<<<<<<<<<<<<<
 *         # print(np.asarray(dqdx))
 *         res = cpwgrad(np.asarray(u)[1, :], np.asarray(dqdx), self.vessels[vessel_index].dx)
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_siz); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_8 = 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_8 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_2);
  __pyx_t_6 = 0;
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_C_v = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "pylsewave/cynum.pyx":1003
 *         cdef double[::1] C_v = np.zeros(siz, np.float)
 *         # print(np.asarray(dqdx))
 *         res = cpwgrad(np.asarray(u)[1, :], np.asarray(dqdx), self.vessels[vessel_index].dx)             # <<<<<<<<<<<<<<
 *         # print(np.asarray(dqdx))
 *         res = self.CV_f(u[0, :], vessel_index, C_v)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_GetItem(__pyx_t_1, __pyx_tuple__8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1003, __pyx_L1_error)
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_dqdx, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1003, __pyx_L1_error)
  __pyx_v_res = __pyx_f_9pylsewave_5cynum_cpwgrad(((PyArrayObject *)__pyx_t_9), ((PyArrayObject *)__pyx_t_1), (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_vessel_index]).dx, 0);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":1005
 *         res = cpwgrad(np.asarray(u)[1, :], np.asarray(dqdx), self.vessels[vessel_index].dx)
 *         # print(np.asarray(dqdx))
 *         res = self.CV_f(u[0, :], vessel_index, C_v)             # <<<<<<<<<<<<<<
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
  __pyx_t_10.data = __pyx_v_u.data;
  __pyx_t_10.memview = __pyx_v_u.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
  {
    Py_ssize_t __pyx_tmp_idx = 0;
    Py_ssize_t __pyx_tmp_shape = __pyx_v_u.shape[0];
    Py_ssize_t __pyx_tmp_stride = __pyx_v_u.strides[0];
    if (0 && (__pyx_tmp_idx < 0))
        __pyx_tmp_idx += __pyx_tmp_shape;
    if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
        PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
        __PYX_ERR(0, 1005, __pyx_L1_error)
    }
        __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_10.shape[0] = __pyx_v_u.shape[1];
__pyx_t_10.strides[0] = __pyx_v_u.strides[1];
    __pyx_t_10.suboffsets[0] = -1;

__pyx_v_res = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEsWatVisco *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->CV_f(__pyx_v_self, __pyx_t_10, __pyx_v_vessel_index, __pyx_v_C_v, 0);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);

  /* "pylsewave/cynum.pyx":1006
 *         # print(np.asarray(dqdx))
 *         res = self.CV_f(u[0, :], vessel_index, C_v)
 *         for i in range(siz):             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_p[i] = (self.vessels[vessel_index].f_r0[i]*(sqrt(u[0, i] / A0) - 1.0) -
 */
  __pyx_t_8 = __pyx_v_siz;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pylsewave/cynum.pyx":1007
 *         res = self.CV_f(u[0, :], vessel_index, C_v)
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *             out_p[i] = (self.vessels[vessel_index].f_r0[i]*(sqrt(u[0, i] / A0) - 1.0) -
 *                         C_v[i]*dqdx[i])
 */
    __pyx_t_10 = (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_10, 1);
    __pyx_t_12 = __pyx_v_i;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_10.data) + __pyx_t_12)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);

    /* "pylsewave/cynum.pyx":1008
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_p[i] = (self.vessels[vessel_index].f_r0[i]*(sqrt(u[0, i] / A0) - 1.0) -             # <<<<<<<<<<<<<<
 *                         C_v[i]*dqdx[i])
 * 
 */
    __pyx_t_10 = (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_10, 1);
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_14 = 0;
    __pyx_t_15 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":1009
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_p[i] = (self.vessels[vessel_index].f_r0[i]*(sqrt(u[0, i] / A0) - 1.0) -
 *                         C_v[i]*dqdx[i])             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_17 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":1008
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_p[i] = (self.vessels[vessel_index].f_r0[i]*(sqrt(u[0, i] / A0) - 1.0) -             # <<<<<<<<<<<<<<
 *                         C_v[i]*dqdx[i])
 * 
 */
    __pyx_t_18 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_p.data) + __pyx_t_18)) )) = (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_10.data) + __pyx_t_13)) ))) * (sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_14 * __pyx_v_u.strides[0]) )) + __pyx_t_15)) ))) / __pyx_v_A0)) - 1.0)) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_C_v.data) + __pyx_t_16)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_dqdx.data) + __pyx_t_17)) )))));
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  }

  /* "pylsewave/cynum.pyx":983
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void pressure_visco(self, double[:, ::1] u, int vessel_index,             # <<<<<<<<<<<<<<
 *      double[::1] out_p):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEsWatVisco.pressure_visco", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_dqdx, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_C_v, 1);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_3pressure_visco(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_13cPDEsWatVisco_2pressure_visco[] = "\n        Method to compute pressure from pressure-area relationship\n\n        .. math::\n             p(A) = f(R_0, k) \\left( \\sqrt{\\frac{A}{A_0} - 1} - C_v \\frac{\\partial q}{\\partial x} \\right)\n\n        :param u: solution vector\n        :type priority: ndarray[ndim=2, type=double]\n        :param int vessel_index: the vessel unique Id\n        :param ndarray[ndim=1, type=double] out_p: the calculated pressue vector.\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_3pressure_visco(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out_p = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pressure_visco (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_vessel_index,&__pyx_n_s_out_p,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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pressure_visco", 1, 3, 3, 1); __PYX_ERR(0, 983, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_p)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pressure_visco", 1, 3, 3, 2); __PYX_ERR(0, 983, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pressure_visco") < 0)) __PYX_ERR(0, 983, __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_u = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 983, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 983, __pyx_L3_error)
    __pyx_v_out_p = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2]); if (unlikely(!__pyx_v_out_p.memview)) __PYX_ERR(0, 984, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pressure_visco", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 983, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEsWatVisco.pressure_visco", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_13cPDEsWatVisco_2pressure_visco(((struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *)__pyx_v_self), __pyx_v_u, __pyx_v_vessel_index, __pyx_v_out_p);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_13cPDEsWatVisco_2pressure_visco(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_p) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pressure_visco", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_pressure_visco(__pyx_v_self, __pyx_v_u, __pyx_v_vessel_index, __pyx_v_out_p, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __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("pylsewave.cynum.cPDEsWatVisco.pressure_visco", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out_p, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1015
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int CV_f(self, double[::1] a, Py_ssize_t vessel_index, double[::1] out):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the CV_f term
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_5CV_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_CV_f(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED int __pyx_v_res;
  double __pyx_v_A0;
  double __pyx_v__phi;
  __Pyx_memviewslice __pyx_v_w_th = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  double __pyx_t_11;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  __Pyx_RefNannySetupContext("CV_f", 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_CV_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_5CV_f)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_a, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_vessel_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_out, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1015, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_10;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":1033
 *         cdef int res
 *         cdef double A0
 *         cdef double _phi = self.vessels[vessel_index].phi             # <<<<<<<<<<<<<<
 *         cdef double[::1] w_th = np.zeros(a.shape[0], dtype=np.float)
 *         res = cPDEsWatVisco.wall_th_x(self.vessels[vessel_index].r0, w_th)
 */
  __pyx_t_11 = (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_vessel_index]).phi;
  __pyx_v__phi = __pyx_t_11;

  /* "pylsewave/cynum.pyx":1034
 *         cdef double A0
 *         cdef double _phi = self.vessels[vessel_index].phi
 *         cdef double[::1] w_th = np.zeros(a.shape[0], dtype=np.float)             # <<<<<<<<<<<<<<
 *         res = cPDEsWatVisco.wall_th_x(self.vessels[vessel_index].r0, w_th)
 *         for i in range(a.shape[0]):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1034, __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_a.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_5);
  if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_w_th = __pyx_t_12;
  __pyx_t_12.memview = NULL;
  __pyx_t_12.data = NULL;

  /* "pylsewave/cynum.pyx":1035
 *         cdef double _phi = self.vessels[vessel_index].phi
 *         cdef double[::1] w_th = np.zeros(a.shape[0], dtype=np.float)
 *         res = cPDEsWatVisco.wall_th_x(self.vessels[vessel_index].r0, w_th)             # <<<<<<<<<<<<<<
 *         for i in range(a.shape[0]):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
  __pyx_v_res = __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_wall_th_x((__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_vessel_index]).r0, __pyx_v_w_th);

  /* "pylsewave/cynum.pyx":1036
 *         cdef double[::1] w_th = np.zeros(a.shape[0], dtype=np.float)
 *         res = cPDEsWatVisco.wall_th_x(self.vessels[vessel_index].r0, w_th)
 *         for i in range(a.shape[0]):             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out[i] = (2./3)*((_phi * w_th[i]*sqrt(M_PI))/(A0*sqrt(a[i])))
 */
  __pyx_t_8 = (__pyx_v_a.shape[0]);
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_8; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "pylsewave/cynum.pyx":1037
 *         res = cPDEsWatVisco.wall_th_x(self.vessels[vessel_index].r0, w_th)
 *         for i in range(a.shape[0]):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *             out[i] = (2./3)*((_phi * w_th[i]*sqrt(M_PI))/(A0*sqrt(a[i])))
 * 
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_14 = __pyx_v_i;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_14)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":1038
 *         for i in range(a.shape[0]):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out[i] = (2./3)*((_phi * w_th[i]*sqrt(M_PI))/(A0*sqrt(a[i])))             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_17 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_17)) )) = ((2. / 3.0) * (((__pyx_v__phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_w_th.data) + __pyx_t_15)) )))) * sqrt(M_PI)) / (__pyx_v_A0 * sqrt((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_a.data) + __pyx_t_16)) )))))));
  }

  /* "pylsewave/cynum.pyx":1040
 *             out[i] = (2./3)*((_phi * w_th[i]*sqrt(M_PI))/(A0*sqrt(a[i])))
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1015
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int CV_f(self, double[::1] a, Py_ssize_t vessel_index, double[::1] out):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the CV_f term
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cPDEsWatVisco.CV_f", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_w_th, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_5CV_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_13cPDEsWatVisco_4CV_f[] = "\n        Method to calculate the CV_f term\n        \n        .. math::\n             CV_f = \\frac{2}{3}\\left( \\frac{\\phi w_{th} \\sqrt{\\pi}}{A_0\\sqrt{a}} \\right)\n        \n        :param a: the cross-sectional area \n        :type priority: ndarray[ndim=1, type=double]\n        :param vessel_index: the vessel index\n        :type priority: int\n        :param out: the calculated vector\n        :type priority: ndarray[ndim=1, type=double]\n        :return: int\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_5CV_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("CV_f (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_vessel_index,&__pyx_n_s_out,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_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("CV_f", 1, 3, 3, 1); __PYX_ERR(0, 1015, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("CV_f", 1, 3, 3, 2); __PYX_ERR(0, 1015, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CV_f") < 0)) __PYX_ERR(0, 1015, __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_a = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_a.memview)) __PYX_ERR(0, 1015, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_vessel_index == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1015, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1015, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("CV_f", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1015, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cPDEsWatVisco.CV_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_13cPDEsWatVisco_4CV_f(((struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *)__pyx_v_self), __pyx_v_a, __pyx_v_vessel_index, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_13cPDEsWatVisco_4CV_f(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *__pyx_v_self, __Pyx_memviewslice __pyx_v_a, Py_ssize_t __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("CV_f", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_CV_f(__pyx_v_self, __pyx_v_a, __pyx_v_vessel_index, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __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("pylsewave.cynum.cPDEsWatVisco.CV_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1047
 *     @cython.cdivision(True)
 *     @staticmethod
 *     cdef int wall_th_x(double[::1] r0, double[::1] out):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the wall thickness
 */

static int __pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_wall_th_x(__Pyx_memviewslice __pyx_v_r0, __Pyx_memviewslice __pyx_v_out) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_siz;
  double __pyx_v_alpha;
  double __pyx_v_beta;
  double __pyx_v_gamma;
  double __pyx_v_d;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  __Pyx_RefNannySetupContext("wall_th_x", 0);

  /* "pylsewave/cynum.pyx":1058
 *         """
 *         cdef Py_ssize_t i
 *         cdef Py_ssize_t siz = r0.shape[0]             # <<<<<<<<<<<<<<
 *         cdef double alpha = 0.2802
 *         cdef double beta = -5.053*0.1
 */
  __pyx_v_siz = (__pyx_v_r0.shape[0]);

  /* "pylsewave/cynum.pyx":1059
 *         cdef Py_ssize_t i
 *         cdef Py_ssize_t siz = r0.shape[0]
 *         cdef double alpha = 0.2802             # <<<<<<<<<<<<<<
 *         cdef double beta = -5.053*0.1
 *         cdef double gamma = 0.1324
 */
  __pyx_v_alpha = 0.2802;

  /* "pylsewave/cynum.pyx":1060
 *         cdef Py_ssize_t siz = r0.shape[0]
 *         cdef double alpha = 0.2802
 *         cdef double beta = -5.053*0.1             # <<<<<<<<<<<<<<
 *         cdef double gamma = 0.1324
 *         cdef double d = -0.1114*0.1
 */
  __pyx_v_beta = (-5.053 * 0.1);

  /* "pylsewave/cynum.pyx":1061
 *         cdef double alpha = 0.2802
 *         cdef double beta = -5.053*0.1
 *         cdef double gamma = 0.1324             # <<<<<<<<<<<<<<
 *         cdef double d = -0.1114*0.1
 * 
 */
  __pyx_v_gamma = 0.1324;

  /* "pylsewave/cynum.pyx":1062
 *         cdef double beta = -5.053*0.1
 *         cdef double gamma = 0.1324
 *         cdef double d = -0.1114*0.1             # <<<<<<<<<<<<<<
 * 
 *         for i in range(siz):
 */
  __pyx_v_d = (-0.1114 * 0.1);

  /* "pylsewave/cynum.pyx":1064
 *         cdef double d = -0.1114*0.1
 * 
 *         for i in range(siz):             # <<<<<<<<<<<<<<
 *             out[i] = r0[i]*(alpha*exp(beta*r0[i]) + gamma*exp(d*r0[i]))
 * 
 */
  __pyx_t_1 = __pyx_v_siz;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":1065
 * 
 *         for i in range(siz):
 *             out[i] = r0[i]*(alpha*exp(beta*r0[i]) + gamma*exp(d*r0[i]))             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_6 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_6)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_r0.data) + __pyx_t_3)) ))) * ((__pyx_v_alpha * exp((__pyx_v_beta * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_r0.data) + __pyx_t_4)) )))))) + (__pyx_v_gamma * exp((__pyx_v_d * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_r0.data) + __pyx_t_5)) ))))))));
  }

  /* "pylsewave/cynum.pyx":1067
 *             out[i] = r0[i]*(alpha*exp(beta*r0[i]) + gamma*exp(d*r0[i]))
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * # ------------------- -------------------------------------------------- ----------------------- #
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1047
 *     @cython.cdivision(True)
 *     @staticmethod
 *     cdef int wall_th_x(double[::1] r0, double[::1] out):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the wall thickness
 */

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

/* "pylsewave/cynum.pyx":1076
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int flux(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_F) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

static int __pyx_f_9pylsewave_5cynum_6PDEmCs_flux(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_F) {
  double __pyx_v_A0;
  double __pyx_v_f_r0;
  __pyx_t_5numpy_intp_t __pyx_v_siz;
  __pyx_t_5numpy_intp_t __pyx_v_i;
  int __pyx_r;
  __pyx_t_5numpy_intp_t __pyx_t_1;
  __pyx_t_5numpy_intp_t __pyx_t_2;
  __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;

  /* "pylsewave/cynum.pyx":1091
 *         cdef np.intp_t siz, i
 * 
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         if x == 0:
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":1093
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":1094
 * 
 *         if x == 0:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":1095
 *         if x == 0:
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 out_F[0, i] = u[1, i]
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_4 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_4)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":1096
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]             # <<<<<<<<<<<<<<
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_5 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_5)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":1097
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 out_F[0, i] = u[1, i]             # <<<<<<<<<<<<<<
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])
 *         elif x == 1:
 */
      __pyx_t_6 = 1;
      __pyx_t_7 = __pyx_v_i;
      __pyx_t_8 = 0;
      __pyx_t_9 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_8 * __pyx_v_out_F.strides[0]) )) + __pyx_t_9)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_6 * __pyx_v_u.strides[0]) )) + __pyx_t_7)) )));

      /* "pylsewave/cynum.pyx":1098
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             for i in range(siz):
 */
      __pyx_t_10 = 1;
      __pyx_t_11 = __pyx_v_i;
      __pyx_t_12 = 1;
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_14 = 0;
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_16 = 0;
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = 1;
      __pyx_t_19 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_18 * __pyx_v_out_F.strides[0]) )) + __pyx_t_19)) )) = ((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_10 * __pyx_v_u.strides[0]) )) + __pyx_t_11)) ))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_12 * __pyx_v_u.strides[0]) )) + __pyx_t_13)) )))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_14 * __pyx_v_u.strides[0]) )) + __pyx_t_15)) )))) + (__pyx_v_f_r0 * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_16 * __pyx_v_u.strides[0]) )) + __pyx_t_17)) )))))));
    }

    /* "pylsewave/cynum.pyx":1093
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":1099
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 */
    case 1:

    /* "pylsewave/cynum.pyx":1100
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])
 *         elif x == 1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":1101
 *         elif x == 1:
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 out_F[0, i] = u[1, i]
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0p;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_20 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_20)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":1102
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]             # <<<<<<<<<<<<<<
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_21 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_21)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":1103
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 out_F[0, i] = u[1, i]             # <<<<<<<<<<<<<<
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])
 *         elif x == -1:
 */
      __pyx_t_22 = 1;
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_24 = 0;
      __pyx_t_25 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_24 * __pyx_v_out_F.strides[0]) )) + __pyx_t_25)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_22 * __pyx_v_u.strides[0]) )) + __pyx_t_23)) )));

      /* "pylsewave/cynum.pyx":1104
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])             # <<<<<<<<<<<<<<
 *         elif x == -1:
 *             for i in range(siz):
 */
      __pyx_t_26 = 1;
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = 1;
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_30 = 0;
      __pyx_t_31 = __pyx_v_i;
      __pyx_t_32 = 0;
      __pyx_t_33 = __pyx_v_i;
      __pyx_t_34 = 1;
      __pyx_t_35 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_34 * __pyx_v_out_F.strides[0]) )) + __pyx_t_35)) )) = ((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_26 * __pyx_v_u.strides[0]) )) + __pyx_t_27)) ))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_28 * __pyx_v_u.strides[0]) )) + __pyx_t_29)) )))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_30 * __pyx_v_u.strides[0]) )) + __pyx_t_31)) )))) + (__pyx_v_f_r0 * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_32 * __pyx_v_u.strides[0]) )) + __pyx_t_33)) )))))));
    }

    /* "pylsewave/cynum.pyx":1099
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":1105
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 */
    case -1L:

    /* "pylsewave/cynum.pyx":1106
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])
 *         elif x == -1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":1107
 *         elif x == -1:
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 out_F[0, i] = u[1, i]
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0m;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_36 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_36)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":1108
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]             # <<<<<<<<<<<<<<
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + f_r0* sqrt(A0*u[0, i])
 */
      __pyx_t_3 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_3, 0);
      __pyx_t_37 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_3.data) + __pyx_t_37)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_3, 0);

      /* "pylsewave/cynum.pyx":1109
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 out_F[0, i] = u[1, i]             # <<<<<<<<<<<<<<
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + f_r0* sqrt(A0*u[0, i])
 * 
 */
      __pyx_t_38 = 1;
      __pyx_t_39 = __pyx_v_i;
      __pyx_t_40 = 0;
      __pyx_t_41 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_40 * __pyx_v_out_F.strides[0]) )) + __pyx_t_41)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_38 * __pyx_v_u.strides[0]) )) + __pyx_t_39)) )));

      /* "pylsewave/cynum.pyx":1110
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + f_r0* sqrt(A0*u[0, i])             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
      __pyx_t_42 = 1;
      __pyx_t_43 = __pyx_v_i;
      __pyx_t_44 = 1;
      __pyx_t_45 = __pyx_v_i;
      __pyx_t_46 = 0;
      __pyx_t_47 = __pyx_v_i;
      __pyx_t_48 = 0;
      __pyx_t_49 = __pyx_v_i;
      __pyx_t_50 = 1;
      __pyx_t_51 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_F.data + __pyx_t_50 * __pyx_v_out_F.strides[0]) )) + __pyx_t_51)) )) = ((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_42 * __pyx_v_u.strides[0]) )) + __pyx_t_43)) ))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_44 * __pyx_v_u.strides[0]) )) + __pyx_t_45)) )))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_46 * __pyx_v_u.strides[0]) )) + __pyx_t_47)) )))) + (__pyx_v_f_r0 * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_48 * __pyx_v_u.strides[0]) )) + __pyx_t_49)) )))))));
    }

    /* "pylsewave/cynum.pyx":1105
 *                 out_F[0, i] = u[1, i]
 *                 out_F[1, i] = ((u[1, i]*u[1, i]) / u[0, i]) + f_r0*sqrt(A0*u[0, i])
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":1112
 *                 out_F[1, i] = ((u[1, i] * u[1, i]) / u[0, i]) + f_r0* sqrt(A0*u[0, i])
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1076
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int flux(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_F) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1118
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void flux_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_f):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_1flux_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_6PDEmCs_flux_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  double __pyx_v_f_r0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  __Pyx_RefNannySetupContext("flux_i", 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_flux_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_6PDEmCs_1flux_i)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_out_f, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":1133
 *         cdef np.intp_t siz, i
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":1134
 * 
 *         if x == 0:
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             out_f[0] = u[1]
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_13 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_13)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":1135
 *         if x == 0:
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]             # <<<<<<<<<<<<<<
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_14 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_14)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":1136
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             out_f[0] = u[1]             # <<<<<<<<<<<<<<
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 *         elif x == 1:
 */
    __pyx_t_15 = 1;
    __pyx_t_16 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_16)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_15)) )));

    /* "pylsewave/cynum.pyx":1137
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 */
    __pyx_t_17 = 1;
    __pyx_t_18 = 1;
    __pyx_t_19 = 0;
    __pyx_t_20 = 0;
    __pyx_t_21 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_21)) )) = ((((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_17)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_18)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_19)) )))) + (__pyx_v_f_r0 * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_20)) )))))));

    /* "pylsewave/cynum.pyx":1133
 *         cdef np.intp_t siz, i
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 */
    break;

    /* "pylsewave/cynum.pyx":1138
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 */
    case 1:

    /* "pylsewave/cynum.pyx":1139
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 *         elif x == 1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             out_f[0] = u[1]
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0p;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_22 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_22)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":1140
 *         elif x == 1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]             # <<<<<<<<<<<<<<
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_23 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_23)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":1141
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             out_f[0] = u[1]             # <<<<<<<<<<<<<<
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 *         elif x == -1:
 */
    __pyx_t_24 = 1;
    __pyx_t_25 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_25)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_24)) )));

    /* "pylsewave/cynum.pyx":1142
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])             # <<<<<<<<<<<<<<
 *         elif x == -1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 */
    __pyx_t_26 = 1;
    __pyx_t_27 = 1;
    __pyx_t_28 = 0;
    __pyx_t_29 = 0;
    __pyx_t_30 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_30)) )) = ((((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_26)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_27)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_28)) )))) + (__pyx_v_f_r0 * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_29)) )))))));

    /* "pylsewave/cynum.pyx":1138
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 */
    break;

    /* "pylsewave/cynum.pyx":1143
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 */
    case -1L:

    /* "pylsewave/cynum.pyx":1144
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 *         elif x == -1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             out_f[0] = u[1]
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0m;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_31 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_31)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":1145
 *         elif x == -1:
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]             # <<<<<<<<<<<<<<
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
    __pyx_t_32 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_12.data) + __pyx_t_32)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);

    /* "pylsewave/cynum.pyx":1146
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             out_f[0] = u[1]             # <<<<<<<<<<<<<<
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 * 
 */
    __pyx_t_33 = 1;
    __pyx_t_34 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_34)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_33)) )));

    /* "pylsewave/cynum.pyx":1147
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])             # <<<<<<<<<<<<<<
 * 
 *     property mesh:
 */
    __pyx_t_35 = 1;
    __pyx_t_36 = 1;
    __pyx_t_37 = 0;
    __pyx_t_38 = 0;
    __pyx_t_39 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_f.data) + __pyx_t_39)) )) = ((((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_35)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_36)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_37)) )))) + (__pyx_v_f_r0 * sqrt((__pyx_v_A0 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_38)) )))))));

    /* "pylsewave/cynum.pyx":1143
 *             out_f[0] = u[1]
 *             out_f[1] = ((u[1]*u[1]) / u[0]) + f_r0*sqrt(A0*u[0])
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":1118
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void flux_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_f):             # <<<<<<<<<<<<<<
 *         """
 *         Method to calculate the Flux term.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.PDEmCs.flux_i", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_1flux_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_6PDEmCs_flux_i[] = "\n        Method to calculate the Flux term.\n    \n        :param u: the solution vector u\n        :type priority: ndarray[ndim=1, dtype=double]\n        :param x: the spatial point\n        :type priority: int\n        :param int vessel_index: the unique vessel Id\n        :param ndarray[ndim=1, dtype=double] out_F: the flux vector\n        :return: int\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_1flux_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_x;
  int __pyx_v_index;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out_f = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flux_i (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_x,&__pyx_n_s_index,&__pyx_n_s_vessel_index,&__pyx_n_s_out_f,0};
    PyObject* values[5] = {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  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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 1); __PYX_ERR(0, 1118, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 2); __PYX_ERR(0, 1118, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 3); __PYX_ERR(0, 1118, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_f)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, 4); __PYX_ERR(0, 1118, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flux_i") < 0)) __PYX_ERR(0, 1118, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
    }
    __pyx_v_u = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 1118, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1118, __pyx_L3_error)
    __pyx_v_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1118, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1118, __pyx_L3_error)
    __pyx_v_out_f = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[4]); if (unlikely(!__pyx_v_out_f.memview)) __PYX_ERR(0, 1118, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flux_i", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1118, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.PDEmCs.flux_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_6PDEmCs_flux_i(((struct __pyx_obj_9pylsewave_5cynum_PDEmCs *)__pyx_v_self), __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_f);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_6PDEmCs_flux_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_f) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("flux_i", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_6PDEmCs_flux_i(__pyx_v_self, __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_f, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __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("pylsewave.cynum.PDEmCs.flux_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out_f, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1150
 * 
 *     property mesh:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.mesh
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_4mesh_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_4mesh_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_6PDEmCs_4mesh___get__(((struct __pyx_obj_9pylsewave_5cynum_PDEmCs *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_6PDEmCs_4mesh___get__(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":1151
 *     property mesh:
 *         def __get__(self):
 *             return self.mesh             # <<<<<<<<<<<<<<
 * 
 *     cdef vector[cvessel] get_vessels(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.mesh);
  __pyx_r = __pyx_v_self->__pyx_base.mesh;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1150
 * 
 *     property mesh:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.mesh
 * 
 */

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

/* "pylsewave/cynum.pyx":1153
 *             return self.mesh
 * 
 *     cdef vector[cvessel] get_vessels(self):             # <<<<<<<<<<<<<<
 *         return self.vessels
 * 
 */

static std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_f_9pylsewave_5cynum_6PDEmCs_get_vessels(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self) {
  std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_vessels", 0);

  /* "pylsewave/cynum.pyx":1154
 * 
 *     cdef vector[cvessel] get_vessels(self):
 *         return self.vessels             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_self->__pyx_base.vessels;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1153
 *             return self.mesh
 * 
 *     cdef vector[cvessel] get_vessels(self):             # <<<<<<<<<<<<<<
 *         return self.vessels
 * 
 */

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

/* "pylsewave/cynum.pyx":1160
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int source(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_S) nogil:             # <<<<<<<<<<<<<<
 *         """
 *          Method to calculate the Source term.
 */

static int __pyx_f_9pylsewave_5cynum_6PDEmCs_source(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_S) {
  double __pyx_v_A0;
  double __pyx_v_R;
  double __pyx_v_f_r0;
  double __pyx_v_df_dr0;
  double __pyx_v_df_dx;
  __pyx_t_5numpy_intp_t __pyx_v_siz;
  __pyx_t_5numpy_intp_t __pyx_v_i;
  int __pyx_r;
  __pyx_t_5numpy_intp_t __pyx_t_1;
  __pyx_t_5numpy_intp_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;

  /* "pylsewave/cynum.pyx":1174
 *         cdef np.intp_t siz, i
 * 
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 * 
 *         if x == 0:
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":1176
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":1177
 * 
 *         if x == 0:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":1178
 *         if x == 0:
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 */
      __pyx_t_3 = 0;
      __pyx_t_4 = __pyx_v_i;
      __pyx_v_R = sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_3 * __pyx_v_u.strides[0]) )) + __pyx_t_4)) ))) / M_PI));

      /* "pylsewave/cynum.pyx":1179
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_6 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_6)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1180
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]             # <<<<<<<<<<<<<<
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_7 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_7)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1181
 *                 A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]             # <<<<<<<<<<<<<<
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_8 = __pyx_v_i;
      __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_8)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1182
 *                 f_r0 = self.vessels[vessel_index].f_r0[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 *                 df_dx = self.vessels[vessel_index].df_dx[i]             # <<<<<<<<<<<<<<
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i])/(self.delta*self.Re*u[0, i])) +
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_9 = __pyx_v_i;
      __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_9)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1183
 *                 df_dr0 = self.vessels[vessel_index].df_dr0[i]
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0             # <<<<<<<<<<<<<<
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i])/(self.delta*self.Re*u[0, i])) +
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 */
      __pyx_t_10 = 0;
      __pyx_t_11 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_10 * __pyx_v_out_S.strides[0]) )) + __pyx_t_11)) )) = 0.0;

      /* "pylsewave/cynum.pyx":1184
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i])/(self.delta*self.Re*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 *         elif x == 1:
 */
      __pyx_t_12 = 1;
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_14 = 0;
      __pyx_t_15 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":1185
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i])/(self.delta*self.Re*u[0, i])) +
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             for i in range(siz):
 */
      __pyx_t_16 = 0;
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = 0;
      __pyx_t_19 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":1184
 *                 df_dx = self.vessels[vessel_index].df_dx[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i])/(self.delta*self.Re*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 *         elif x == 1:
 */
      __pyx_t_20 = 1;
      __pyx_t_21 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_20 * __pyx_v_out_S.strides[0]) )) + __pyx_t_21)) )) = (((((-2. * M_PI) * __pyx_v_R) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_12 * __pyx_v_u.strides[0]) )) + __pyx_t_13)) )))) / ((__pyx_v_self->__pyx_base.delta * __pyx_v_self->__pyx_base.Re) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_14 * __pyx_v_u.strides[0]) )) + __pyx_t_15)) ))))) + ((((2. * sqrt((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_16 * __pyx_v_u.strides[0]) )) + __pyx_t_17)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_18 * __pyx_v_u.strides[0]) )) + __pyx_t_19)) ))) * __pyx_v_df_dr0)) * __pyx_v_df_dx));
    }

    /* "pylsewave/cynum.pyx":1176
 *         siz = u.shape[1]
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    break;

    /* "pylsewave/cynum.pyx":1186
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i])/(self.delta*self.Re*u[0, i])) +
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    case 1:

    /* "pylsewave/cynum.pyx":1187
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 *         elif x == 1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":1188
 *         elif x == 1:
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 */
      __pyx_t_22 = 0;
      __pyx_t_23 = __pyx_v_i;
      __pyx_v_R = sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_22 * __pyx_v_u.strides[0]) )) + __pyx_t_23)) ))) / M_PI));

      /* "pylsewave/cynum.pyx":1189
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0p;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_24 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_24)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1190
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]             # <<<<<<<<<<<<<<
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_25 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_25)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1191
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]             # <<<<<<<<<<<<<<
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_26 = __pyx_v_i;
      __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_26)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1192
 *                 f_r0 = self.vessels[vessel_index].f_r0_ph[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]             # <<<<<<<<<<<<<<
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx_ph;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_27 = __pyx_v_i;
      __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_27)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1193
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_ph[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0             # <<<<<<<<<<<<<<
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 */
      __pyx_t_28 = 0;
      __pyx_t_29 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_28 * __pyx_v_out_S.strides[0]) )) + __pyx_t_29)) )) = 0.0;

      /* "pylsewave/cynum.pyx":1194
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 *         elif x == -1:
 */
      __pyx_t_30 = 1;
      __pyx_t_31 = __pyx_v_i;
      __pyx_t_32 = 0;
      __pyx_t_33 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":1195
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 *         elif x == -1:
 *             for i in range(siz):
 */
      __pyx_t_34 = 0;
      __pyx_t_35 = __pyx_v_i;
      __pyx_t_36 = 0;
      __pyx_t_37 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":1194
 *                 df_dx = self.vessels[vessel_index].df_dx_ph[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 *         elif x == -1:
 */
      __pyx_t_38 = 1;
      __pyx_t_39 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_38 * __pyx_v_out_S.strides[0]) )) + __pyx_t_39)) )) = (((((-2. * M_PI) * __pyx_v_R) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_30 * __pyx_v_u.strides[0]) )) + __pyx_t_31)) )))) / ((__pyx_v_self->__pyx_base.delta * __pyx_v_self->__pyx_base.Re) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_32 * __pyx_v_u.strides[0]) )) + __pyx_t_33)) ))))) + ((((2. * sqrt((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_34 * __pyx_v_u.strides[0]) )) + __pyx_t_35)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_36 * __pyx_v_u.strides[0]) )) + __pyx_t_37)) ))) * __pyx_v_df_dr0)) * __pyx_v_df_dx));
    }

    /* "pylsewave/cynum.pyx":1186
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i])/(self.delta*self.Re*u[0, i])) +
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i]*df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    break;

    /* "pylsewave/cynum.pyx":1196
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    case -1L:

    /* "pylsewave/cynum.pyx":1197
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 *         elif x == -1:
 *             for i in range(siz):             # <<<<<<<<<<<<<<
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 */
    __pyx_t_1 = __pyx_v_siz;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "pylsewave/cynum.pyx":1198
 *         elif x == -1:
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)             # <<<<<<<<<<<<<<
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 */
      __pyx_t_40 = 0;
      __pyx_t_41 = __pyx_v_i;
      __pyx_v_R = sqrt(((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_40 * __pyx_v_u.strides[0]) )) + __pyx_t_41)) ))) / M_PI));

      /* "pylsewave/cynum.pyx":1199
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)             # <<<<<<<<<<<<<<
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0m;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_42 = __pyx_v_i;
      __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_42)) ))), 2.0));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1200
 *                 R = sqrt(u[0, i] / M_PI)
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]             # <<<<<<<<<<<<<<
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_43 = __pyx_v_i;
      __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_43)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1201
 *                 A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[i], 2)
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]             # <<<<<<<<<<<<<<
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_44 = __pyx_v_i;
      __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_44)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1202
 *                 f_r0 = self.vessels[vessel_index].f_r0_mh[i]
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]             # <<<<<<<<<<<<<<
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +
 */
      __pyx_t_5 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx_mh;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
      __pyx_t_45 = __pyx_v_i;
      __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_5.data) + __pyx_t_45)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);

      /* "pylsewave/cynum.pyx":1203
 *                 df_dr0 = self.vessels[vessel_index].df_dr0_mh[i]
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0             # <<<<<<<<<<<<<<
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 */
      __pyx_t_46 = 0;
      __pyx_t_47 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_46 * __pyx_v_out_S.strides[0]) )) + __pyx_t_47)) )) = 0.0;

      /* "pylsewave/cynum.pyx":1204
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 * 
 */
      __pyx_t_48 = 1;
      __pyx_t_49 = __pyx_v_i;
      __pyx_t_50 = 0;
      __pyx_t_51 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":1205
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
      __pyx_t_52 = 0;
      __pyx_t_53 = __pyx_v_i;
      __pyx_t_54 = 0;
      __pyx_t_55 = __pyx_v_i;

      /* "pylsewave/cynum.pyx":1204
 *                 df_dx = self.vessels[vessel_index].df_dx_mh[i]
 *                 out_S[0, i] = 0.0
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +             # <<<<<<<<<<<<<<
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 * 
 */
      __pyx_t_56 = 1;
      __pyx_t_57 = __pyx_v_i;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out_S.data + __pyx_t_56 * __pyx_v_out_S.strides[0]) )) + __pyx_t_57)) )) = (((((-2. * M_PI) * __pyx_v_R) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_48 * __pyx_v_u.strides[0]) )) + __pyx_t_49)) )))) / ((__pyx_v_self->__pyx_base.delta * __pyx_v_self->__pyx_base.Re) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_50 * __pyx_v_u.strides[0]) )) + __pyx_t_51)) ))))) + ((((2. * sqrt((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_52 * __pyx_v_u.strides[0]) )) + __pyx_t_53)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_54 * __pyx_v_u.strides[0]) )) + __pyx_t_55)) ))) * __pyx_v_df_dr0)) * __pyx_v_df_dx));
    }

    /* "pylsewave/cynum.pyx":1196
 *                 out_S[1, i] = (((-2.*M_PI*R*u[1, i]) / (self.delta*self.Re*u[0, i])) +
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             for i in range(siz):
 *                 R = sqrt(u[0, i] / M_PI)
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":1207
 *                                (2.*sqrt(u[0, i])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) - u[0, i] * df_dr0)*df_dx)
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1160
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int source(self, double[:, ::1] u, int x, int vessel_index, double[:, ::1] out_S) nogil:             # <<<<<<<<<<<<<<
 *         """
 *          Method to calculate the Source term.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1213
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void source_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_s):             # <<<<<<<<<<<<<<
 *         """
 *          Method to calculate the Source term.
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_3source_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_6PDEmCs_source_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  double __pyx_v_R;
  double __pyx_v_f_r0;
  double __pyx_v_df_dr0;
  double __pyx_v_df_dx;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  __Pyx_RefNannySetupContext("source_i", 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_source_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_6PDEmCs_3source_i)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_out_s, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":1226
 *         cdef double A0, R, f_r0, df_dr0, df_dx
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 */
  switch (__pyx_v_x) {
    case 0:

    /* "pylsewave/cynum.pyx":1227
 * 
 *         if x == 0:
 *             R = sqrt(u[0] / M_PI)             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 */
    __pyx_t_12 = 0;
    __pyx_v_R = sqrt(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_12)) ))) / M_PI));

    /* "pylsewave/cynum.pyx":1228
 *         if x == 0:
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_14 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_14)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1229
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]             # <<<<<<<<<<<<<<
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_15 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_15)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1230
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]             # <<<<<<<<<<<<<<
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_16 = __pyx_v_index;
    __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_16)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1231
 *             f_r0 = self.vessels[vessel_index].f_r0[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 *             df_dx = self.vessels[vessel_index].df_dx[index]             # <<<<<<<<<<<<<<
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_17 = __pyx_v_index;
    __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_17)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1232
 *             df_dr0 = self.vessels[vessel_index].df_dr0[index]
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0             # <<<<<<<<<<<<<<
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 */
    __pyx_t_18 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_18)) )) = 0.0;

    /* "pylsewave/cynum.pyx":1233
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +             # <<<<<<<<<<<<<<
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_19 = 1;
    __pyx_t_20 = 0;

    /* "pylsewave/cynum.pyx":1234
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -             # <<<<<<<<<<<<<<
 *                          u[0] * df_dr0)*df_dx)
 *         elif x == 1:
 */
    __pyx_t_21 = 0;

    /* "pylsewave/cynum.pyx":1235
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 *         elif x == 1:
 *             R = sqrt(u[0] / M_PI)
 */
    __pyx_t_22 = 0;

    /* "pylsewave/cynum.pyx":1233
 *             df_dx = self.vessels[vessel_index].df_dx[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +             # <<<<<<<<<<<<<<
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_23 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_23)) )) = (((((-2. * M_PI) * __pyx_v_R) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_19)) )))) / ((__pyx_v_self->__pyx_base.delta * __pyx_v_self->__pyx_base.Re) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_20)) ))))) + ((((2. * sqrt((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_21)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_22)) ))) * __pyx_v_df_dr0)) * __pyx_v_df_dx));

    /* "pylsewave/cynum.pyx":1226
 *         cdef double A0, R, f_r0, df_dr0, df_dx
 * 
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":1236
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 */
    case 1:

    /* "pylsewave/cynum.pyx":1237
 *                          u[0] * df_dr0)*df_dx)
 *         elif x == 1:
 *             R = sqrt(u[0] / M_PI)             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 */
    __pyx_t_24 = 0;
    __pyx_v_R = sqrt(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_24)) ))) / M_PI));

    /* "pylsewave/cynum.pyx":1238
 *         elif x == 1:
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0p;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_25 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_25)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1239
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]             # <<<<<<<<<<<<<<
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_26 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_26)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1240
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]             # <<<<<<<<<<<<<<
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_27 = __pyx_v_index;
    __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_27)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1241
 *             f_r0 = self.vessels[vessel_index].f_r0_ph[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]             # <<<<<<<<<<<<<<
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx_ph;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_28 = __pyx_v_index;
    __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_28)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1242
 *             df_dr0 = self.vessels[vessel_index].df_dr0_ph[index]
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0             # <<<<<<<<<<<<<<
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 */
    __pyx_t_29 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_29)) )) = 0.0;

    /* "pylsewave/cynum.pyx":1243
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +             # <<<<<<<<<<<<<<
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_30 = 1;
    __pyx_t_31 = 0;

    /* "pylsewave/cynum.pyx":1244
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -             # <<<<<<<<<<<<<<
 *                          u[0] * df_dr0)*df_dx)
 * 
 */
    __pyx_t_32 = 0;

    /* "pylsewave/cynum.pyx":1245
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 * 
 *         elif x == -1:
 */
    __pyx_t_33 = 0;

    /* "pylsewave/cynum.pyx":1243
 *             df_dx = self.vessels[vessel_index].df_dx_ph[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +             # <<<<<<<<<<<<<<
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_34 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_34)) )) = (((((-2. * M_PI) * __pyx_v_R) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_30)) )))) / ((__pyx_v_self->__pyx_base.delta * __pyx_v_self->__pyx_base.Re) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_31)) ))))) + ((((2. * sqrt((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_32)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_33)) ))) * __pyx_v_df_dr0)) * __pyx_v_df_dx));

    /* "pylsewave/cynum.pyx":1236
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 *         elif x == 1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0p[index], 2)
 */
    break;

    /* "pylsewave/cynum.pyx":1247
 *                          u[0] * df_dr0)*df_dx)
 * 
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 */
    case -1L:

    /* "pylsewave/cynum.pyx":1248
 * 
 *         elif x == -1:
 *             R = sqrt(u[0] / M_PI)             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 */
    __pyx_t_35 = 0;
    __pyx_v_R = sqrt(((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_35)) ))) / M_PI));

    /* "pylsewave/cynum.pyx":1249
 *         elif x == -1:
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)             # <<<<<<<<<<<<<<
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).interpolate_R0m;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_36 = __pyx_v_index;
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_36)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1250
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]             # <<<<<<<<<<<<<<
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_37 = __pyx_v_index;
    __pyx_v_f_r0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_37)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1251
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]             # <<<<<<<<<<<<<<
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dr0_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_38 = __pyx_v_index;
    __pyx_v_df_dr0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_38)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1252
 *             f_r0 = self.vessels[vessel_index].f_r0_mh[index]
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]             # <<<<<<<<<<<<<<
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 */
    __pyx_t_13 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).df_dx_mh;
    __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
    __pyx_t_39 = __pyx_v_index;
    __pyx_v_df_dx = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_13.data) + __pyx_t_39)) )));
    __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

    /* "pylsewave/cynum.pyx":1253
 *             df_dr0 = self.vessels[vessel_index].df_dr0_mh[index]
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0             # <<<<<<<<<<<<<<
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 */
    __pyx_t_40 = 0;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_40)) )) = 0.0;

    /* "pylsewave/cynum.pyx":1254
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +             # <<<<<<<<<<<<<<
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_41 = 1;
    __pyx_t_42 = 0;

    /* "pylsewave/cynum.pyx":1255
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -             # <<<<<<<<<<<<<<
 *                          u[0] * df_dr0)*df_dx)
 * 
 */
    __pyx_t_43 = 0;

    /* "pylsewave/cynum.pyx":1256
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_44 = 0;

    /* "pylsewave/cynum.pyx":1254
 *             df_dx = self.vessels[vessel_index].df_dx_mh[index]
 *             out_s[0] = 0.0
 *             out_s[1] = (((-2.*M_PI*R*u[1]) / (self.delta*self.Re*u[0])) +             # <<<<<<<<<<<<<<
 *                         (2.*sqrt(u[0])*(sqrt(M_PI)*f_r0 + sqrt(A0)*df_dr0) -
 *                          u[0] * df_dr0)*df_dx)
 */
    __pyx_t_45 = 1;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_s.data) + __pyx_t_45)) )) = (((((-2. * M_PI) * __pyx_v_R) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_41)) )))) / ((__pyx_v_self->__pyx_base.delta * __pyx_v_self->__pyx_base.Re) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_42)) ))))) + ((((2. * sqrt((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_43)) ))))) * ((sqrt(M_PI) * __pyx_v_f_r0) + (sqrt(__pyx_v_A0) * __pyx_v_df_dr0))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_44)) ))) * __pyx_v_df_dr0)) * __pyx_v_df_dx));

    /* "pylsewave/cynum.pyx":1247
 *                          u[0] * df_dr0)*df_dx)
 * 
 *         elif x == -1:             # <<<<<<<<<<<<<<
 *             R = sqrt(u[0] / M_PI)
 *             A0 = M_PI*pow(self.vessels[vessel_index].interpolate_R0m[index], 2)
 */
    break;
    default: break;
  }

  /* "pylsewave/cynum.pyx":1213
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef void source_i(self, double[::1] u, int x, int index, int vessel_index, double[::1] out_s):             # <<<<<<<<<<<<<<
 *         """
 *          Method to calculate the Source term.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.PDEmCs.source_i", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_3source_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_6PDEmCs_2source_i[] = "\n         Method to calculate the Source term.\n\n        :param u: the solution vector u\n        :type priority: ndarray[ndim=1, dtype=double]\n        :param x: the spatial point index\n        :type priority: int\n        :param int vessel_index: the unique vessel Id\n        :param ndarray[ndim=1, dtype=double] out_S: the source vector \n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_3source_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_x;
  int __pyx_v_index;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out_s = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("source_i (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_x,&__pyx_n_s_index,&__pyx_n_s_vessel_index,&__pyx_n_s_out_s,0};
    PyObject* values[5] = {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  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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 1); __PYX_ERR(0, 1213, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 2); __PYX_ERR(0, 1213, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 3); __PYX_ERR(0, 1213, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_s)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, 4); __PYX_ERR(0, 1213, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "source_i") < 0)) __PYX_ERR(0, 1213, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
    }
    __pyx_v_u = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 1213, __pyx_L3_error)
    __pyx_v_x = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1213, __pyx_L3_error)
    __pyx_v_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1213, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1213, __pyx_L3_error)
    __pyx_v_out_s = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[4]); if (unlikely(!__pyx_v_out_s.memview)) __PYX_ERR(0, 1213, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("source_i", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1213, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.PDEmCs.source_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_6PDEmCs_2source_i(((struct __pyx_obj_9pylsewave_5cynum_PDEmCs *)__pyx_v_self), __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_s);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_6PDEmCs_2source_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("source_i", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_6PDEmCs_source_i(__pyx_v_self, __pyx_v_u, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out_s, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __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("pylsewave.cynum.PDEmCs.source_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out_s, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1263
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cpdef double compute_c_i(self, double a, int index, int vessel_index):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_5compute_c_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_9pylsewave_5cynum_6PDEmCs_compute_c_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  double __pyx_v_out;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __Pyx_RefNannySetupContext("compute_c_i", 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_compute_c_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_6PDEmCs_5compute_c_i)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1263, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_10;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":1278
 *         cdef double A0
 *         cdef double out
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *         out = -sqrt(0.5*self.vessels[vessel_index].f_r0[index]*sqrt(A0/a))
 *         return out
 */
  __pyx_t_11 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
  __pyx_t_12 = __pyx_v_index;
  __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_12)) ))), 2.0));
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);

  /* "pylsewave/cynum.pyx":1279
 *         cdef double out
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out = -sqrt(0.5*self.vessels[vessel_index].f_r0[index]*sqrt(A0/a))             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
  __pyx_t_11 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
  __pyx_t_13 = __pyx_v_index;
  __pyx_v_out = (-sqrt(((0.5 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_13)) )))) * sqrt((__pyx_v_A0 / __pyx_v_a)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);

  /* "pylsewave/cynum.pyx":1280
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out = -sqrt(0.5*self.vessels[vessel_index].f_r0[index]*sqrt(A0/a))
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     # @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1263
 *     @cython.boundscheck(False)
 *     @cython.wraparound(False)
 *     cpdef double compute_c_i(self, double a, int index, int vessel_index):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.PDEmCs.compute_c_i", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_5compute_c_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_6PDEmCs_4compute_c_i[] = "\n        Method to compute local wave speed\n\n        .. math::\n             c(A) = -\\sqrt{\\frac{1}{2 \\rho} f(R_0, k) \\sqrt{\\frac{A_0)}{A}}}\n\n        :param a: the cross-sectional area of the vessel\n        :type priority: double\n        :param int index: the number or the node to be calculated\n        :param vessel_index: the vessel unique Id\n        :return: double\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_5compute_c_i(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_a;
  int __pyx_v_index;
  int __pyx_v_vessel_index;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_c_i (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_index,&__pyx_n_s_vessel_index,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_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c_i", 1, 3, 3, 1); __PYX_ERR(0, 1263, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c_i", 1, 3, 3, 2); __PYX_ERR(0, 1263, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_c_i") < 0)) __PYX_ERR(0, 1263, __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_a = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_a == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1263, __pyx_L3_error)
    __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1263, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1263, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compute_c_i", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1263, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.PDEmCs.compute_c_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_6PDEmCs_4compute_c_i(((struct __pyx_obj_9pylsewave_5cynum_PDEmCs *)__pyx_v_self), __pyx_v_a, __pyx_v_index, __pyx_v_vessel_index);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_6PDEmCs_4compute_c_i(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, double __pyx_v_a, int __pyx_v_index, int __pyx_v_vessel_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("compute_c_i", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_9pylsewave_5cynum_6PDEmCs_compute_c_i(__pyx_v_self, __pyx_v_a, __pyx_v_index, __pyx_v_vessel_index, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __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("pylsewave.cynum.PDEmCs.compute_c_i", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1285
 *     # @cython.cdivision(True)
 *     # @cython.boundscheck(False)
 *     cpdef void compute_c(self, double[:, ::1] u, int vessel_index, double[::1] out_c):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_7compute_c(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_6PDEmCs_compute_c(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_siz;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  double __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  __Pyx_RefNannySetupContext("compute_c", 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_compute_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_6PDEmCs_7compute_c)) {
      if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 1285, __pyx_L1_error) }
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(!__pyx_v_out_c.memview)) { __Pyx_RaiseUnboundLocalError("out_c"); __PYX_ERR(0, 1285, __pyx_L1_error) }
      __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_out_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":1301
 *         cdef double A0
 *         cdef Py_ssize_t i, siz
 *         siz = u.shape[1]             # <<<<<<<<<<<<<<
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 */
  __pyx_v_siz = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":1302
 *         cdef Py_ssize_t i, siz
 *         siz = u.shape[1]
 *         for i in range(siz):             # <<<<<<<<<<<<<<
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_c[i] = -sqrt(0.5*self.vessels[vessel_index].f_r0[i]*sqrt(A0/u[0, i]))
 */
  __pyx_t_8 = __pyx_v_siz;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_8; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "pylsewave/cynum.pyx":1303
 *         siz = u.shape[1]
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)             # <<<<<<<<<<<<<<
 *             out_c[i] = -sqrt(0.5*self.vessels[vessel_index].f_r0[i]*sqrt(A0/u[0, i]))
 * 
 */
    if (unlikely(!(__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 1303, __pyx_L1_error)}
    __pyx_t_11 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).r0;
    __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_t_11.shape[0];
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_t_11.shape[0])) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      __PYX_ERR(0, 1303, __pyx_L1_error)
    }
    __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_12)) ))), 2.0));
    __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);

    /* "pylsewave/cynum.pyx":1304
 *         for i in range(siz):
 *             A0 = M_PI*pow(self.vessels[vessel_index].r0[i], 2)
 *             out_c[i] = -sqrt(0.5*self.vessels[vessel_index].f_r0[i]*sqrt(A0/u[0, i]))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(!(__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 1304, __pyx_L1_error)}
    __pyx_t_11 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_vessel_index]).f_r0;
    __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_t_11.shape[0];
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_t_11.shape[0])) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      __PYX_ERR(0, 1304, __pyx_L1_error)
    }
    __pyx_t_15 = 0;
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_v_u.shape[0];
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_v_u.shape[0])) __pyx_t_13 = 0;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_v_u.shape[1];
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 1;
    } else if (unlikely(__pyx_t_16 >= __pyx_v_u.shape[1])) __pyx_t_13 = 1;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      __PYX_ERR(0, 1304, __pyx_L1_error)
    }
    __pyx_t_17 = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_15 * __pyx_v_u.strides[0]) )) + __pyx_t_16)) )));
    if (unlikely(__pyx_t_17 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 1304, __pyx_L1_error)
    }
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_v_out_c.shape[0];
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_18 >= __pyx_v_out_c.shape[0])) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      __PYX_ERR(0, 1304, __pyx_L1_error)
    }
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out_c.data) + __pyx_t_18)) )) = (-sqrt(((0.5 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_14)) )))) * sqrt((__pyx_v_A0 / __pyx_t_17)))));
    __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  }

  /* "pylsewave/cynum.pyx":1285
 *     # @cython.cdivision(True)
 *     # @cython.boundscheck(False)
 *     cpdef void compute_c(self, double[:, ::1] u, int vessel_index, double[::1] out_c):             # <<<<<<<<<<<<<<
 *         """
 *         Method to compute local wave speed
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.PDEmCs.compute_c", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_7compute_c(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pylsewave_5cynum_6PDEmCs_6compute_c[] = "\n        Method to compute local wave speed\n\n        .. math::\n             c(A) = -\\sqrt{\\frac{1}{2 \\rho} f(R_0, k) \\sqrt{\\frac{A_0)}{A}}}\n\n        :param u: the solution vector\n        :type priority: ndarray[ndim=2, type=double]\n        :param int index: the number or the node to be calculated\n        :param vessel_index: the vessel unique Id\n        :param out_c: the calculated wave speed vector\n        :type priority: ndarray[ndim=1, type=double]\n        ";
static PyObject *__pyx_pw_9pylsewave_5cynum_6PDEmCs_7compute_c(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out_c = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_c (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_vessel_index,&__pyx_n_s_out_c,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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c", 1, 3, 3, 1); __PYX_ERR(0, 1285, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_c)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_c", 1, 3, 3, 2); __PYX_ERR(0, 1285, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_c") < 0)) __PYX_ERR(0, 1285, __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_u = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 1285, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1285, __pyx_L3_error)
    __pyx_v_out_c = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[2]); if (unlikely(!__pyx_v_out_c.memview)) __PYX_ERR(0, 1285, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compute_c", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1285, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.PDEmCs.compute_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_6PDEmCs_6compute_c(((struct __pyx_obj_9pylsewave_5cynum_PDEmCs *)__pyx_v_self), __pyx_v_u, __pyx_v_vessel_index, __pyx_v_out_c);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_6PDEmCs_6compute_c(struct __pyx_obj_9pylsewave_5cynum_PDEmCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("compute_c", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 1285, __pyx_L1_error) }
  if (unlikely(!__pyx_v_out_c.memview)) { __Pyx_RaiseUnboundLocalError("out_c"); __PYX_ERR(0, 1285, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_6PDEmCs_compute_c(__pyx_v_self, __pyx_v_u, __pyx_v_vessel_index, __pyx_v_out_c, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __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("pylsewave.cynum.PDEmCs.compute_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out_c, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1319
 *     cdef vector[cvessel] vessels
 *     cdef double _rho
 *     def __init__(self, cPDEm inpdes, inletfunc):             # <<<<<<<<<<<<<<
 *         self.mesh = inpdes.mesh
 *         self._rho = inpdes._rho
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_4cBCs_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_4cBCs_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_inpdes = 0;
  PyObject *__pyx_v_inletfunc = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inpdes,&__pyx_n_s_inletfunc,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_inpdes)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inletfunc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1319, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1319, __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_inpdes = ((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)values[0]);
    __pyx_v_inletfunc = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1319, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cBCs.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inpdes), __pyx_ptype_9pylsewave_5cynum_cPDEm, 1, "inpdes", 0))) __PYX_ERR(0, 1319, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pylsewave_5cynum_4cBCs___init__(((struct __pyx_obj_9pylsewave_5cynum_cBCs *)__pyx_v_self), __pyx_v_inpdes, __pyx_v_inletfunc);

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

static int __pyx_pf_9pylsewave_5cynum_4cBCs___init__(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_inpdes, PyObject *__pyx_v_inletfunc) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  double __pyx_t_2;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pylsewave/cynum.pyx":1320
 *     cdef double _rho
 *     def __init__(self, cPDEm inpdes, inletfunc):
 *         self.mesh = inpdes.mesh             # <<<<<<<<<<<<<<
 *         self._rho = inpdes._rho
 *         self.pdes = inpdes
 */
  __pyx_t_1 = __pyx_v_inpdes->mesh;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->mesh);
  __Pyx_DECREF(__pyx_v_self->mesh);
  __pyx_v_self->mesh = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":1321
 *     def __init__(self, cPDEm inpdes, inletfunc):
 *         self.mesh = inpdes.mesh
 *         self._rho = inpdes._rho             # <<<<<<<<<<<<<<
 *         self.pdes = inpdes
 *         self.inlet_fun = inletfunc
 */
  __pyx_t_2 = __pyx_v_inpdes->_rho;
  __pyx_v_self->_rho = __pyx_t_2;

  /* "pylsewave/cynum.pyx":1322
 *         self.mesh = inpdes.mesh
 *         self._rho = inpdes._rho
 *         self.pdes = inpdes             # <<<<<<<<<<<<<<
 *         self.inlet_fun = inletfunc
 *         self.vessels = inpdes.get_vessels()
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_inpdes));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_inpdes));
  __Pyx_GOTREF(__pyx_v_self->pdes);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->pdes));
  __pyx_v_self->pdes = __pyx_v_inpdes;

  /* "pylsewave/cynum.pyx":1323
 *         self._rho = inpdes._rho
 *         self.pdes = inpdes
 *         self.inlet_fun = inletfunc             # <<<<<<<<<<<<<<
 *         self.vessels = inpdes.get_vessels()
 * 
 */
  __Pyx_INCREF(__pyx_v_inletfunc);
  __Pyx_GIVEREF(__pyx_v_inletfunc);
  __Pyx_GOTREF(__pyx_v_self->inlet_fun);
  __Pyx_DECREF(__pyx_v_self->inlet_fun);
  __pyx_v_self->inlet_fun = __pyx_v_inletfunc;

  /* "pylsewave/cynum.pyx":1324
 *         self.pdes = inpdes
 *         self.inlet_fun = inletfunc
 *         self.vessels = inpdes.get_vessels()             # <<<<<<<<<<<<<<
 * 
 *     cdef void set_vessels(self, vector[cvessel] invessels):
 */
  __pyx_v_self->vessels = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_inpdes->__pyx_vtab)->get_vessels(__pyx_v_inpdes);

  /* "pylsewave/cynum.pyx":1319
 *     cdef vector[cvessel] vessels
 *     cdef double _rho
 *     def __init__(self, cPDEm inpdes, inletfunc):             # <<<<<<<<<<<<<<
 *         self.mesh = inpdes.mesh
 *         self._rho = inpdes._rho
 */

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

/* "pylsewave/cynum.pyx":1326
 *         self.vessels = inpdes.get_vessels()
 * 
 *     cdef void set_vessels(self, vector[cvessel] invessels):             # <<<<<<<<<<<<<<
 *         self.vessels = invessels
 * 
 */

static void __pyx_f_9pylsewave_5cynum_4cBCs_set_vessels(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_v_invessels) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_vessels", 0);

  /* "pylsewave/cynum.pyx":1327
 * 
 *     cdef void set_vessels(self, vector[cvessel] invessels):
 *         self.vessels = invessels             # <<<<<<<<<<<<<<
 * 
 *     cdef cPDEm get_pdes(self):
 */
  __pyx_v_self->vessels = __pyx_v_invessels;

  /* "pylsewave/cynum.pyx":1326
 *         self.vessels = inpdes.get_vessels()
 * 
 *     cdef void set_vessels(self, vector[cvessel] invessels):             # <<<<<<<<<<<<<<
 *         self.vessels = invessels
 * 
 */

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

/* "pylsewave/cynum.pyx":1329
 *         self.vessels = invessels
 * 
 *     cdef cPDEm get_pdes(self):             # <<<<<<<<<<<<<<
 *         return self.pdes
 * 
 */

static struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_f_9pylsewave_5cynum_4cBCs_get_pdes(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self) {
  struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_pdes", 0);

  /* "pylsewave/cynum.pyx":1330
 * 
 *     cdef cPDEm get_pdes(self):
 *         return self.pdes             # <<<<<<<<<<<<<<
 * 
 *     cdef void set_pdes(self, cPDEm pdes):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->pdes));
  __pyx_r = __pyx_v_self->pdes;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1329
 *         self.vessels = invessels
 * 
 *     cdef cPDEm get_pdes(self):             # <<<<<<<<<<<<<<
 *         return self.pdes
 * 
 */

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

/* "pylsewave/cynum.pyx":1332
 *         return self.pdes
 * 
 *     cdef void set_pdes(self, cPDEm pdes):             # <<<<<<<<<<<<<<
 *         self.pdes = pdes
 * 
 */

static void __pyx_f_9pylsewave_5cynum_4cBCs_set_pdes(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, struct __pyx_obj_9pylsewave_5cynum_cPDEm *__pyx_v_pdes) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_pdes", 0);

  /* "pylsewave/cynum.pyx":1333
 * 
 *     cdef void set_pdes(self, cPDEm pdes):
 *         self.pdes = pdes             # <<<<<<<<<<<<<<
 * 
 *     # @cython.cdivision(True)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_pdes));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_pdes));
  __Pyx_GOTREF(__pyx_v_self->pdes);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->pdes));
  __pyx_v_self->pdes = __pyx_v_pdes;

  /* "pylsewave/cynum.pyx":1332
 *         return self.pdes
 * 
 *     cdef void set_pdes(self, cPDEm pdes):             # <<<<<<<<<<<<<<
 *         self.pdes = pdes
 * 
 */

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

/* "pylsewave/cynum.pyx":1337
 *     # @cython.cdivision(True)
 *     # @cython.boundscheck(False)
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         cdef double theta, dt2, _q0_nh, _q0_n, q12_nh, A0
 *         cdef double[:, ::1] F_, S_
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_3U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_4cBCs_U_0(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  double __pyx_v_theta;
  double __pyx_v_dt2;
  double __pyx_v__q0_nh;
  double __pyx_v__q0_n;
  double __pyx_v_q12_nh;
  double __pyx_v_A0;
  __Pyx_memviewslice __pyx_v_F_ = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_S_ = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v__A = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v__q = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_u12_nh = { 0, 0, { 0 }, { 0 }, { 0 } };
  size_t __pyx_v_rws;
  size_t __pyx_v_clms;
  size_t __pyx_v_i;
  size_t __pyx_v_j;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
  size_t __pyx_t_15;
  size_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  size_t __pyx_t_18;
  int __pyx_t_19;
  size_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  size_t __pyx_t_22;
  size_t __pyx_t_23;
  double __pyx_t_24;
  size_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  size_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  size_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  size_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  size_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  size_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  size_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  __Pyx_RefNannySetupContext("U_0", 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_U_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_4cBCs_3U_0)) {
      if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 1337, __pyx_L1_error) }
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 1337, __pyx_L1_error) }
      __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_out, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_9 = __pyx_t_1; __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_12 = PyTuple_New(6+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_11, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_11, __pyx_t_8);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":1342
 *         cdef double[::1] _A, _q, u12_nh
 *         cdef size_t rws, clms, i, j
 *         rws = u.shape[0]             # <<<<<<<<<<<<<<
 *         clms = u.shape[1]
 *         _A = np.zeros(clms, dtype=np.float)
 */
  __pyx_v_rws = (__pyx_v_u.shape[0]);

  /* "pylsewave/cynum.pyx":1343
 *         cdef size_t rws, clms, i, j
 *         rws = u.shape[0]
 *         clms = u.shape[1]             # <<<<<<<<<<<<<<
 *         _A = np.zeros(clms, dtype=np.float)
 *         _q = np.zeros(clms, dtype=np.float)
 */
  __pyx_v_clms = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":1344
 *         rws = u.shape[0]
 *         clms = u.shape[1]
 *         _A = np.zeros(clms, dtype=np.float)             # <<<<<<<<<<<<<<
 *         _q = np.zeros(clms, dtype=np.float)
 *         u12_nh = np.zeros(2, dtype=np.float)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_clms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_float); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_8);
  if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v__A = __pyx_t_13;
  __pyx_t_13.memview = NULL;
  __pyx_t_13.data = NULL;

  /* "pylsewave/cynum.pyx":1345
 *         clms = u.shape[1]
 *         _A = np.zeros(clms, dtype=np.float)
 *         _q = np.zeros(clms, dtype=np.float)             # <<<<<<<<<<<<<<
 *         u12_nh = np.zeros(2, dtype=np.float)
 *         F_ = np.zeros((rws, clms), dtype=np.float)
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_clms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
  __pyx_t_8 = 0;
  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_12);
  if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_v__q = __pyx_t_13;
  __pyx_t_13.memview = NULL;
  __pyx_t_13.data = NULL;

  /* "pylsewave/cynum.pyx":1346
 *         _A = np.zeros(clms, dtype=np.float)
 *         _q = np.zeros(clms, dtype=np.float)
 *         u12_nh = np.zeros(2, dtype=np.float)             # <<<<<<<<<<<<<<
 *         F_ = np.zeros((rws, clms), dtype=np.float)
 *         S_ = np.zeros((rws, clms), dtype=np.float)
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__9, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
  if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_u12_nh = __pyx_t_13;
  __pyx_t_13.memview = NULL;
  __pyx_t_13.data = NULL;

  /* "pylsewave/cynum.pyx":1347
 *         _q = np.zeros(clms, dtype=np.float)
 *         u12_nh = np.zeros(2, dtype=np.float)
 *         F_ = np.zeros((rws, clms), dtype=np.float)             # <<<<<<<<<<<<<<
 *         S_ = np.zeros((rws, clms), dtype=np.float)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_rws); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_clms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
  __pyx_t_1 = 0;
  __pyx_t_8 = 0;
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_2);
  if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_F_ = __pyx_t_14;
  __pyx_t_14.memview = NULL;
  __pyx_t_14.data = NULL;

  /* "pylsewave/cynum.pyx":1348
 *         u12_nh = np.zeros(2, dtype=np.float)
 *         F_ = np.zeros((rws, clms), dtype=np.float)
 *         S_ = np.zeros((rws, clms), dtype=np.float)             # <<<<<<<<<<<<<<
 * 
 *         for j in range(clms):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_rws); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_clms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8);
  __pyx_t_2 = 0;
  __pyx_t_8 = 0;
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1);
  if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_S_ = __pyx_t_14;
  __pyx_t_14.memview = NULL;
  __pyx_t_14.data = NULL;

  /* "pylsewave/cynum.pyx":1350
 *         S_ = np.zeros((rws, clms), dtype=np.float)
 * 
 *         for j in range(clms):             # <<<<<<<<<<<<<<
 *             _A[j] = u[0, j]
 *             _q[j] = u[1, j]
 */
  __pyx_t_15 = __pyx_v_clms;
  for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
    __pyx_v_j = __pyx_t_16;

    /* "pylsewave/cynum.pyx":1351
 * 
 *         for j in range(clms):
 *             _A[j] = u[0, j]             # <<<<<<<<<<<<<<
 *             _q[j] = u[1, j]
 * 
 */
    __pyx_t_17 = 0;
    __pyx_t_18 = __pyx_v_j;
    __pyx_t_19 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_v_u.shape[0];
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_19 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_v_u.shape[0])) __pyx_t_19 = 0;
    if (unlikely(__pyx_t_18 >= (size_t)__pyx_v_u.shape[1])) __pyx_t_19 = 1;
    if (unlikely(__pyx_t_19 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_19);
      __PYX_ERR(0, 1351, __pyx_L1_error)
    }
    __pyx_t_20 = __pyx_v_j;
    __pyx_t_19 = -1;
    if (unlikely(__pyx_t_20 >= (size_t)__pyx_v__A.shape[0])) __pyx_t_19 = 0;
    if (unlikely(__pyx_t_19 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_19);
      __PYX_ERR(0, 1351, __pyx_L1_error)
    }
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v__A.data) + __pyx_t_20)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_17 * __pyx_v_u.strides[0]) )) + __pyx_t_18)) )));

    /* "pylsewave/cynum.pyx":1352
 *         for j in range(clms):
 *             _A[j] = u[0, j]
 *             _q[j] = u[1, j]             # <<<<<<<<<<<<<<
 * 
 *         theta = dt/dx
 */
    __pyx_t_21 = 1;
    __pyx_t_22 = __pyx_v_j;
    __pyx_t_19 = -1;
    if (__pyx_t_21 < 0) {
      __pyx_t_21 += __pyx_v_u.shape[0];
      if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 0;
    } else if (unlikely(__pyx_t_21 >= __pyx_v_u.shape[0])) __pyx_t_19 = 0;
    if (unlikely(__pyx_t_22 >= (size_t)__pyx_v_u.shape[1])) __pyx_t_19 = 1;
    if (unlikely(__pyx_t_19 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_19);
      __PYX_ERR(0, 1352, __pyx_L1_error)
    }
    __pyx_t_23 = __pyx_v_j;
    __pyx_t_19 = -1;
    if (unlikely(__pyx_t_23 >= (size_t)__pyx_v__q.shape[0])) __pyx_t_19 = 0;
    if (unlikely(__pyx_t_19 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_19);
      __PYX_ERR(0, 1352, __pyx_L1_error)
    }
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v__q.data) + __pyx_t_23)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_21 * __pyx_v_u.strides[0]) )) + __pyx_t_22)) )));
  }

  /* "pylsewave/cynum.pyx":1354
 *             _q[j] = u[1, j]
 * 
 *         theta = dt/dx             # <<<<<<<<<<<<<<
 *         dt2 = dt/2.
 * 
 */
  if (unlikely(__pyx_v_dx == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1354, __pyx_L1_error)
  }
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":1355
 * 
 *         theta = dt/dx
 *         dt2 = dt/2.             # <<<<<<<<<<<<<<
 * 
 *         _q0_nh = self.inlet_fun(t - dt / 2.)
 */
  __pyx_v_dt2 = (__pyx_v_dt / 2.);

  /* "pylsewave/cynum.pyx":1357
 *         dt2 = dt/2.
 * 
 *         _q0_nh = self.inlet_fun(t - dt / 2.)             # <<<<<<<<<<<<<<
 *         _q0_n = self.inlet_fun(t)
 * 
 */
  __pyx_t_12 = PyFloat_FromDouble((__pyx_v_t - (__pyx_v_dt / 2.))); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(__pyx_v_self->inlet_fun);
  __pyx_t_8 = __pyx_v_self->inlet_fun; __pyx_t_9 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_9) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); __pyx_t_9 = NULL;
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__q0_nh = __pyx_t_24;

  /* "pylsewave/cynum.pyx":1358
 * 
 *         _q0_nh = self.inlet_fun(t - dt / 2.)
 *         _q0_n = self.inlet_fun(t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_self->inlet_fun);
  __pyx_t_2 = __pyx_v_self->inlet_fun; __pyx_t_12 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_12) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __pyx_t_12 = NULL;
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__q0_n = __pyx_t_24;

  /* "pylsewave/cynum.pyx":1361
 * 
 * 
 *         self.pdes.flux(u, 0, vessel_index, F_)             # <<<<<<<<<<<<<<
 *         self.pdes.source(u, 0, vessel_index, S_)
 * 
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->flux(__pyx_v_self->pdes, __pyx_v_u, 0, __pyx_v_vessel_index, __pyx_v_F_);

  /* "pylsewave/cynum.pyx":1362
 * 
 *         self.pdes.flux(u, 0, vessel_index, F_)
 *         self.pdes.source(u, 0, vessel_index, S_)             # <<<<<<<<<<<<<<
 * 
 *         # U[1/2, 1/2]
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->source(__pyx_v_self->pdes, __pyx_v_u, 0, __pyx_v_vessel_index, __pyx_v_S_);

  /* "pylsewave/cynum.pyx":1365
 * 
 *         # U[1/2, 1/2]
 *         for i in range(rws):             # <<<<<<<<<<<<<<
 *             u12_nh[i] = ((u[i, 1] + u[i, 0]) / 2. -
 *                          0.5 * theta * (F_[i, 1] - F_[i, 0]) +
 */
  __pyx_t_15 = __pyx_v_rws;
  for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
    __pyx_v_i = __pyx_t_16;

    /* "pylsewave/cynum.pyx":1366
 *         # U[1/2, 1/2]
 *         for i in range(rws):
 *             u12_nh[i] = ((u[i, 1] + u[i, 0]) / 2. -             # <<<<<<<<<<<<<<
 *                          0.5 * theta * (F_[i, 1] - F_[i, 0]) +
 *                          0.5 * dt2 * (S_[i, 1] + S_[i, 0]))
 */
    __pyx_t_25 = __pyx_v_i;
    __pyx_t_26 = 1;
    __pyx_t_19 = -1;
    if (unlikely(__pyx_t_25 >= (size_t)__pyx_v_u.shape[0])) __pyx_t_19 = 0;
    if (__pyx_t_26 < 0) {
      __pyx_t_26 += __pyx_v_u.shape[1];
      if (unlikely(__pyx_t_26 < 0)) __pyx_t_19 = 1;
    } else if (unlikely(__pyx_t_26 >= __pyx_v_u.shape[1])) __pyx_t_19 = 1;
    if (unlikely(__pyx_t_19 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_19);
      __PYX_ERR(0, 1366, __pyx_L1_error)
    }
    __pyx_t_27 = __pyx_v_i;
    __pyx_t_28 = 0;
    __pyx_t_19 = -1;
    if (unlikely(__pyx_t_27 >= (size_t)__pyx_v_u.shape[0])) __pyx_t_19 = 0;
    if (__pyx_t_28 < 0) {
      __pyx_t_28 += __pyx_v_u.shape[1];
      if (unlikely(__pyx_t_28 < 0)) __pyx_t_19 = 1;
    } else if (unlikely(__pyx_t_28 >= __pyx_v_u.shape[1])) __pyx_t_19 = 1;
    if (unlikely(__pyx_t_19 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_19);
      __PYX_ERR(0, 1366, __pyx_L1_error)
    }

    /* "pylsewave/cynum.pyx":1367
 *         for i in range(rws):
 *             u12_nh[i] = ((u[i, 1] + u[i, 0]) / 2. -
 *                          0.5 * theta * (F_[i, 1] - F_[i, 0]) +             # <<<<<<<<<<<<<<
 *                          0.5 * dt2 * (S_[i, 1] + S_[i, 0]))
 *         # q[1/2, 1/2]
 */
    __pyx_t_29 = __pyx_v_i;
    __pyx_t_30 = 1;
    __pyx_t_19 = -1;
    if (unlikely(__pyx_t_29 >= (size_t)__pyx_v_F_.shape[0])) __pyx_t_19 = 0;
    if (__pyx_t_30 < 0) {
      __pyx_t_30 += __pyx_v_F_.shape[1];
      if (unlikely(__pyx_t_30 < 0)) __pyx_t_19 = 1;
    } else if (unlikely(__pyx_t_30 >= __pyx_v_F_.shape[1])) __pyx_t_19 = 1;
    if (unlikely(__pyx_t_19 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_19);
      __PYX_ERR(0, 1367, __pyx_L1_error)
    }
    __pyx_t_31 = __pyx_v_i;
    __pyx_t_32 = 0;
    __pyx_t_19 = -1;
    if (unlikely(__pyx_t_31 >= (size_t)__pyx_v_F_.shape[0])) __pyx_t_19 = 0;
    if (__pyx_t_32 < 0) {
      __pyx_t_32 += __pyx_v_F_.shape[1];
      if (unlikely(__pyx_t_32 < 0)) __pyx_t_19 = 1;
    } else if (unlikely(__pyx_t_32 >= __pyx_v_F_.shape[1])) __pyx_t_19 = 1;
    if (unlikely(__pyx_t_19 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_19);
      __PYX_ERR(0, 1367, __pyx_L1_error)
    }

    /* "pylsewave/cynum.pyx":1368
 *             u12_nh[i] = ((u[i, 1] + u[i, 0]) / 2. -
 *                          0.5 * theta * (F_[i, 1] - F_[i, 0]) +
 *                          0.5 * dt2 * (S_[i, 1] + S_[i, 0]))             # <<<<<<<<<<<<<<
 *         # q[1/2, 1/2]
 *         # print "u12_nh: ", u12_nh
 */
    __pyx_t_33 = __pyx_v_i;
    __pyx_t_34 = 1;
    __pyx_t_19 = -1;
    if (unlikely(__pyx_t_33 >= (size_t)__pyx_v_S_.shape[0])) __pyx_t_19 = 0;
    if (__pyx_t_34 < 0) {
      __pyx_t_34 += __pyx_v_S_.shape[1];
      if (unlikely(__pyx_t_34 < 0)) __pyx_t_19 = 1;
    } else if (unlikely(__pyx_t_34 >= __pyx_v_S_.shape[1])) __pyx_t_19 = 1;
    if (unlikely(__pyx_t_19 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_19);
      __PYX_ERR(0, 1368, __pyx_L1_error)
    }
    __pyx_t_35 = __pyx_v_i;
    __pyx_t_36 = 0;
    __pyx_t_19 = -1;
    if (unlikely(__pyx_t_35 >= (size_t)__pyx_v_S_.shape[0])) __pyx_t_19 = 0;
    if (__pyx_t_36 < 0) {
      __pyx_t_36 += __pyx_v_S_.shape[1];
      if (unlikely(__pyx_t_36 < 0)) __pyx_t_19 = 1;
    } else if (unlikely(__pyx_t_36 >= __pyx_v_S_.shape[1])) __pyx_t_19 = 1;
    if (unlikely(__pyx_t_19 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_19);
      __PYX_ERR(0, 1368, __pyx_L1_error)
    }

    /* "pylsewave/cynum.pyx":1366
 *         # U[1/2, 1/2]
 *         for i in range(rws):
 *             u12_nh[i] = ((u[i, 1] + u[i, 0]) / 2. -             # <<<<<<<<<<<<<<
 *                          0.5 * theta * (F_[i, 1] - F_[i, 0]) +
 *                          0.5 * dt2 * (S_[i, 1] + S_[i, 0]))
 */
    __pyx_t_37 = __pyx_v_i;
    __pyx_t_19 = -1;
    if (unlikely(__pyx_t_37 >= (size_t)__pyx_v_u12_nh.shape[0])) __pyx_t_19 = 0;
    if (unlikely(__pyx_t_19 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_19);
      __PYX_ERR(0, 1366, __pyx_L1_error)
    }
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u12_nh.data) + __pyx_t_37)) )) = (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_25 * __pyx_v_u.strides[0]) )) + __pyx_t_26)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_27 * __pyx_v_u.strides[0]) )) + __pyx_t_28)) )))) / 2.) - ((0.5 * __pyx_v_theta) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_F_.data + __pyx_t_29 * __pyx_v_F_.strides[0]) )) + __pyx_t_30)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_F_.data + __pyx_t_31 * __pyx_v_F_.strides[0]) )) + __pyx_t_32)) )))))) + ((0.5 * __pyx_v_dt2) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_S_.data + __pyx_t_33 * __pyx_v_S_.strides[0]) )) + __pyx_t_34)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_S_.data + __pyx_t_35 * __pyx_v_S_.strides[0]) )) + __pyx_t_36)) ))))));
  }

  /* "pylsewave/cynum.pyx":1371
 *         # q[1/2, 1/2]
 *         # print "u12_nh: ", u12_nh
 *         q12_nh = u12_nh[1]             # <<<<<<<<<<<<<<
 *         # A[n+1, 0]
 *         A0 = _A[0] - (2. * theta) * (q12_nh - _q0_nh)
 */
  __pyx_t_38 = 1;
  __pyx_t_19 = -1;
  if (__pyx_t_38 < 0) {
    __pyx_t_38 += __pyx_v_u12_nh.shape[0];
    if (unlikely(__pyx_t_38 < 0)) __pyx_t_19 = 0;
  } else if (unlikely(__pyx_t_38 >= __pyx_v_u12_nh.shape[0])) __pyx_t_19 = 0;
  if (unlikely(__pyx_t_19 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_19);
    __PYX_ERR(0, 1371, __pyx_L1_error)
  }
  __pyx_v_q12_nh = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u12_nh.data) + __pyx_t_38)) )));

  /* "pylsewave/cynum.pyx":1373
 *         q12_nh = u12_nh[1]
 *         # A[n+1, 0]
 *         A0 = _A[0] - (2. * theta) * (q12_nh - _q0_nh)             # <<<<<<<<<<<<<<
 * 
 *         out[0, 0] = A0
 */
  __pyx_t_39 = 0;
  __pyx_t_19 = -1;
  if (__pyx_t_39 < 0) {
    __pyx_t_39 += __pyx_v__A.shape[0];
    if (unlikely(__pyx_t_39 < 0)) __pyx_t_19 = 0;
  } else if (unlikely(__pyx_t_39 >= __pyx_v__A.shape[0])) __pyx_t_19 = 0;
  if (unlikely(__pyx_t_19 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_19);
    __PYX_ERR(0, 1373, __pyx_L1_error)
  }
  __pyx_v_A0 = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v__A.data) + __pyx_t_39)) ))) - ((2. * __pyx_v_theta) * (__pyx_v_q12_nh - __pyx_v__q0_nh)));

  /* "pylsewave/cynum.pyx":1375
 *         A0 = _A[0] - (2. * theta) * (q12_nh - _q0_nh)
 * 
 *         out[0, 0] = A0             # <<<<<<<<<<<<<<
 *         out[1, 0] = _q0_n
 * 
 */
  __pyx_t_40 = 0;
  __pyx_t_41 = 0;
  __pyx_t_19 = -1;
  if (__pyx_t_40 < 0) {
    __pyx_t_40 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_40 < 0)) __pyx_t_19 = 0;
  } else if (unlikely(__pyx_t_40 >= __pyx_v_out.shape[0])) __pyx_t_19 = 0;
  if (__pyx_t_41 < 0) {
    __pyx_t_41 += __pyx_v_out.shape[1];
    if (unlikely(__pyx_t_41 < 0)) __pyx_t_19 = 1;
  } else if (unlikely(__pyx_t_41 >= __pyx_v_out.shape[1])) __pyx_t_19 = 1;
  if (unlikely(__pyx_t_19 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_19);
    __PYX_ERR(0, 1375, __pyx_L1_error)
  }
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_40 * __pyx_v_out.strides[0]) )) + __pyx_t_41)) )) = __pyx_v_A0;

  /* "pylsewave/cynum.pyx":1376
 * 
 *         out[0, 0] = A0
 *         out[1, 0] = _q0_n             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_t_42 = 1;
  __pyx_t_43 = 0;
  __pyx_t_19 = -1;
  if (__pyx_t_42 < 0) {
    __pyx_t_42 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_42 < 0)) __pyx_t_19 = 0;
  } else if (unlikely(__pyx_t_42 >= __pyx_v_out.shape[0])) __pyx_t_19 = 0;
  if (__pyx_t_43 < 0) {
    __pyx_t_43 += __pyx_v_out.shape[1];
    if (unlikely(__pyx_t_43 < 0)) __pyx_t_19 = 1;
  } else if (unlikely(__pyx_t_43 >= __pyx_v_out.shape[1])) __pyx_t_19 = 1;
  if (unlikely(__pyx_t_19 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_19);
    __PYX_ERR(0, 1376, __pyx_L1_error)
  }
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_42 * __pyx_v_out.strides[0]) )) + __pyx_t_43)) )) = __pyx_v__q0_n;

  /* "pylsewave/cynum.pyx":1337
 *     # @cython.cdivision(True)
 *     # @cython.boundscheck(False)
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         cdef double theta, dt2, _q0_nh, _q0_n, q12_nh, A0
 *         cdef double[:, ::1] F_, S_
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cBCs.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_F_, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_S_, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v__A, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v__q, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_u12_nh, 1);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_3U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_3U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_t;
  double __pyx_v_dx;
  double __pyx_v_dt;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("U_0 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_t,&__pyx_n_s_dx,&__pyx_n_s_dt,&__pyx_n_s_vessel_index,&__pyx_n_s_out,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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 1); __PYX_ERR(0, 1337, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 2); __PYX_ERR(0, 1337, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 3); __PYX_ERR(0, 1337, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 4); __PYX_ERR(0, 1337, __pyx_L3_error)
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 5); __PYX_ERR(0, 1337, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "U_0") < 0)) __PYX_ERR(0, 1337, __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_u = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 1337, __pyx_L3_error)
    __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1337, __pyx_L3_error)
    __pyx_v_dx = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1337, __pyx_L3_error)
    __pyx_v_dt = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1337, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1337, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[5]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1337, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1337, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cBCs.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_4cBCs_2U_0(((struct __pyx_obj_9pylsewave_5cynum_cBCs *)__pyx_v_self), __pyx_v_u, __pyx_v_t, __pyx_v_dx, __pyx_v_dt, __pyx_v_vessel_index, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_4cBCs_2U_0(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("U_0", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 1337, __pyx_L1_error) }
  if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 1337, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_4cBCs_U_0(__pyx_v_self, __pyx_v_u, __pyx_v_t, __pyx_v_dx, __pyx_v_dt, __pyx_v_vessel_index, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __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("pylsewave.cynum.cBCs.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1382
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int U_L(self, double[:, ::1] u, double t, double dx, double dt,             # <<<<<<<<<<<<<<
 *                   int vessel_index, double[:, ::1] out) nogil except *:
 *         cdef double theta, dt2, out_a, out_q, p0, p_out, x
 */

static int __pyx_f_9pylsewave_5cynum_4cBCs_U_L(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out) {
  double __pyx_v_theta;
  CYTHON_UNUSED double __pyx_v_dt2;
  double __pyx_v_out_a;
  double __pyx_v_out_q;
  double __pyx_v_p0;
  double __pyx_v_p_out;
  double __pyx_v_x;
  CYTHON_UNUSED size_t __pyx_v_rws;
  size_t __pyx_v_clms;
  double __pyx_v_q_m1;
  int __pyx_v_k;
  double __pyx_v_R1;
  double __pyx_v_Rt;
  double __pyx_v_Ct;
  double __pyx_v_p_old;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  size_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  size_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  size_t __pyx_t_6;
  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  size_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  size_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  size_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  size_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  size_t __pyx_t_21;

  /* "pylsewave/cynum.pyx":1387
 *         cdef size_t rws, clms, i, j
 *         cdef double q_m1
 *         rws = u.shape[0]             # <<<<<<<<<<<<<<
 *         clms = u.shape[1]
 *         theta = dt/dx
 */
  __pyx_v_rws = (__pyx_v_u.shape[0]);

  /* "pylsewave/cynum.pyx":1388
 *         cdef double q_m1
 *         rws = u.shape[0]
 *         clms = u.shape[1]             # <<<<<<<<<<<<<<
 *         theta = dt/dx
 *         dt2 = dt/2.
 */
  __pyx_v_clms = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":1389
 *         rws = u.shape[0]
 *         clms = u.shape[1]
 *         theta = dt/dx             # <<<<<<<<<<<<<<
 *         dt2 = dt/2.
 *         q_m1 = out[1, clms-2]
 */
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":1390
 *         clms = u.shape[1]
 *         theta = dt/dx
 *         dt2 = dt/2.             # <<<<<<<<<<<<<<
 *         q_m1 = out[1, clms-2]
 * 
 */
  __pyx_v_dt2 = (__pyx_v_dt / 2.);

  /* "pylsewave/cynum.pyx":1391
 *         theta = dt/dx
 *         dt2 = dt/2.
 *         q_m1 = out[1, clms-2]             # <<<<<<<<<<<<<<
 * 
 *         p_out = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)
 */
  __pyx_t_1 = 1;
  __pyx_t_2 = (__pyx_v_clms - 2);
  __pyx_v_q_m1 = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_1 * __pyx_v_out.strides[0]) )) + __pyx_t_2)) )));

  /* "pylsewave/cynum.pyx":1393
 *         q_m1 = out[1, clms-2]
 * 
 *         p_out = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)             # <<<<<<<<<<<<<<
 *         p0 = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)
 * 
 */
  __pyx_t_3 = 0;
  __pyx_t_4 = (__pyx_v_clms - 1);
  __pyx_v_p_out = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->pressure_i(__pyx_v_self->pdes, (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_3 * __pyx_v_u.strides[0]) )) + __pyx_t_4)) ))), (__pyx_v_clms - 1), __pyx_v_vessel_index);

  /* "pylsewave/cynum.pyx":1394
 * 
 *         p_out = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)
 *         p0 = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)             # <<<<<<<<<<<<<<
 * 
 *         cdef int k = 0
 */
  __pyx_t_5 = 0;
  __pyx_t_6 = (__pyx_v_clms - 1);
  __pyx_v_p0 = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->pressure_i(__pyx_v_self->pdes, (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_5 * __pyx_v_u.strides[0]) )) + __pyx_t_6)) ))), (__pyx_v_clms - 1), __pyx_v_vessel_index);

  /* "pylsewave/cynum.pyx":1396
 *         p0 = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)
 * 
 *         cdef int k = 0             # <<<<<<<<<<<<<<
 *         cdef double R1, Rt, Ct, p_old
 * 
 */
  __pyx_v_k = 0;

  /* "pylsewave/cynum.pyx":1399
 *         cdef double R1, Rt, Ct, p_old
 * 
 *         R1 = self.vessels[vessel_index].RLC[0]             # <<<<<<<<<<<<<<
 *         Rt = self.vessels[vessel_index].RLC[1]
 *         Ct = self.vessels[vessel_index].RLC[2]
 */
  __pyx_t_7 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).RLC;
  __PYX_INC_MEMVIEW(&__pyx_t_7, 0);
  __pyx_t_8 = 0;
  __pyx_v_R1 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_7.data) + __pyx_t_8)) )));
  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 0);

  /* "pylsewave/cynum.pyx":1400
 * 
 *         R1 = self.vessels[vessel_index].RLC[0]
 *         Rt = self.vessels[vessel_index].RLC[1]             # <<<<<<<<<<<<<<
 *         Ct = self.vessels[vessel_index].RLC[2]
 * 
 */
  __pyx_t_7 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).RLC;
  __PYX_INC_MEMVIEW(&__pyx_t_7, 0);
  __pyx_t_9 = 1;
  __pyx_v_Rt = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_7.data) + __pyx_t_9)) )));
  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 0);

  /* "pylsewave/cynum.pyx":1401
 *         R1 = self.vessels[vessel_index].RLC[0]
 *         Rt = self.vessels[vessel_index].RLC[1]
 *         Ct = self.vessels[vessel_index].RLC[2]             # <<<<<<<<<<<<<<
 * 
 *         x = (dt / (R1*Rt*Ct))
 */
  __pyx_t_7 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).RLC;
  __PYX_INC_MEMVIEW(&__pyx_t_7, 0);
  __pyx_t_10 = 2;
  __pyx_v_Ct = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_7.data) + __pyx_t_10)) )));
  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 0);

  /* "pylsewave/cynum.pyx":1403
 *         Ct = self.vessels[vessel_index].RLC[2]
 * 
 *         x = (dt / (R1*Rt*Ct))             # <<<<<<<<<<<<<<
 *         while k < 1000:
 *             p_old = p0
 */
  __pyx_v_x = (__pyx_v_dt / ((__pyx_v_R1 * __pyx_v_Rt) * __pyx_v_Ct));

  /* "pylsewave/cynum.pyx":1404
 * 
 *         x = (dt / (R1*Rt*Ct))
 *         while k < 1000:             # <<<<<<<<<<<<<<
 *             p_old = p0
 *             out_q = (x*p_out - x*(R1 + Rt)*u[1, clms-1] +
 */
  while (1) {
    __pyx_t_11 = ((__pyx_v_k < 0x3E8) != 0);
    if (!__pyx_t_11) break;

    /* "pylsewave/cynum.pyx":1405
 *         x = (dt / (R1*Rt*Ct))
 *         while k < 1000:
 *             p_old = p0             # <<<<<<<<<<<<<<
 *             out_q = (x*p_out - x*(R1 + Rt)*u[1, clms-1] +
 *                      (p0 - p_out) / R1 + u[1, clms-1])
 */
    __pyx_v_p_old = __pyx_v_p0;

    /* "pylsewave/cynum.pyx":1406
 *         while k < 1000:
 *             p_old = p0
 *             out_q = (x*p_out - x*(R1 + Rt)*u[1, clms-1] +             # <<<<<<<<<<<<<<
 *                      (p0 - p_out) / R1 + u[1, clms-1])
 * 
 */
    __pyx_t_12 = 1;
    __pyx_t_13 = (__pyx_v_clms - 1);

    /* "pylsewave/cynum.pyx":1407
 *             p_old = p0
 *             out_q = (x*p_out - x*(R1 + Rt)*u[1, clms-1] +
 *                      (p0 - p_out) / R1 + u[1, clms-1])             # <<<<<<<<<<<<<<
 * 
 *             out_a = u[0, clms-1] - theta*(out_q - q_m1)
 */
    __pyx_t_14 = 1;
    __pyx_t_15 = (__pyx_v_clms - 1);
    __pyx_v_out_q = ((((__pyx_v_x * __pyx_v_p_out) - ((__pyx_v_x * (__pyx_v_R1 + __pyx_v_Rt)) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_12 * __pyx_v_u.strides[0]) )) + __pyx_t_13)) ))))) + ((__pyx_v_p0 - __pyx_v_p_out) / __pyx_v_R1)) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_14 * __pyx_v_u.strides[0]) )) + __pyx_t_15)) ))));

    /* "pylsewave/cynum.pyx":1409
 *                      (p0 - p_out) / R1 + u[1, clms-1])
 * 
 *             out_a = u[0, clms-1] - theta*(out_q - q_m1)             # <<<<<<<<<<<<<<
 *             p0 = self.pdes.pressure_i(out_a, index=clms-1, vessel_index=vessel_index)
 *             if fabs(p_old - p0) < 1e-7:
 */
    __pyx_t_16 = 0;
    __pyx_t_17 = (__pyx_v_clms - 1);
    __pyx_v_out_a = ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_16 * __pyx_v_u.strides[0]) )) + __pyx_t_17)) ))) - (__pyx_v_theta * (__pyx_v_out_q - __pyx_v_q_m1)));

    /* "pylsewave/cynum.pyx":1410
 * 
 *             out_a = u[0, clms-1] - theta*(out_q - q_m1)
 *             p0 = self.pdes.pressure_i(out_a, index=clms-1, vessel_index=vessel_index)             # <<<<<<<<<<<<<<
 *             if fabs(p_old - p0) < 1e-7:
 *                 break
 */
    __pyx_v_p0 = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->pressure_i(__pyx_v_self->pdes, __pyx_v_out_a, (__pyx_v_clms - 1), __pyx_v_vessel_index);

    /* "pylsewave/cynum.pyx":1411
 *             out_a = u[0, clms-1] - theta*(out_q - q_m1)
 *             p0 = self.pdes.pressure_i(out_a, index=clms-1, vessel_index=vessel_index)
 *             if fabs(p_old - p0) < 1e-7:             # <<<<<<<<<<<<<<
 *                 break
 *             k += 1
 */
    __pyx_t_11 = ((fabs((__pyx_v_p_old - __pyx_v_p0)) < 1e-7) != 0);
    if (__pyx_t_11) {

      /* "pylsewave/cynum.pyx":1412
 *             p0 = self.pdes.pressure_i(out_a, index=clms-1, vessel_index=vessel_index)
 *             if fabs(p_old - p0) < 1e-7:
 *                 break             # <<<<<<<<<<<<<<
 *             k += 1
 * 
 */
      goto __pyx_L4_break;

      /* "pylsewave/cynum.pyx":1411
 *             out_a = u[0, clms-1] - theta*(out_q - q_m1)
 *             p0 = self.pdes.pressure_i(out_a, index=clms-1, vessel_index=vessel_index)
 *             if fabs(p_old - p0) < 1e-7:             # <<<<<<<<<<<<<<
 *                 break
 *             k += 1
 */
    }

    /* "pylsewave/cynum.pyx":1413
 *             if fabs(p_old - p0) < 1e-7:
 *                 break
 *             k += 1             # <<<<<<<<<<<<<<
 * 
 *         out[0, clms-1] = out_a
 */
    __pyx_v_k = (__pyx_v_k + 1);
  }
  __pyx_L4_break:;

  /* "pylsewave/cynum.pyx":1415
 *             k += 1
 * 
 *         out[0, clms-1] = out_a             # <<<<<<<<<<<<<<
 *         out[1, clms-1] = out_q
 * 
 */
  __pyx_t_18 = 0;
  __pyx_t_19 = (__pyx_v_clms - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_18 * __pyx_v_out.strides[0]) )) + __pyx_t_19)) )) = __pyx_v_out_a;

  /* "pylsewave/cynum.pyx":1416
 * 
 *         out[0, clms-1] = out_a
 *         out[1, clms-1] = out_q             # <<<<<<<<<<<<<<
 * 
 *         return STATUS_OK
 */
  __pyx_t_20 = 1;
  __pyx_t_21 = (__pyx_v_clms - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) )) + __pyx_t_21)) )) = __pyx_v_out_q;

  /* "pylsewave/cynum.pyx":1418
 *         out[1, clms-1] = out_q
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 *     # @cython.boundscheck(False)
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1382
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int U_L(self, double[:, ::1] u, double t, double dx, double dt,             # <<<<<<<<<<<<<<
 *                   int vessel_index, double[:, ::1] out) nogil except *:
 *         cdef double theta, dt2, out_a, out_q, p0, p_out, x
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1421
 * 
 *     # @cython.boundscheck(False)
 *     cpdef void I(self, double x, int index, int vessel_index, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double A0
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_5I(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_4cBCs_I(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, CYTHON_UNUSED double __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  double __pyx_v_A0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __Pyx_RefNannySetupContext("I", 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_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_4cBCs_5I)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 1421, __pyx_L1_error) }
      __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_out, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_9 = 1;
        }
      }
      __pyx_t_10 = PyTuple_New(4+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_t_6);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":1423
 *     cpdef void I(self, double x, int index, int vessel_index, double[::1] out):
 *         cdef double A0
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)             # <<<<<<<<<<<<<<
 *         out[0] = A0
 *         out[1] = 0.0
 */
  if (unlikely(!(__pyx_v_self->vessels[__pyx_v_vessel_index]).r0.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 1423, __pyx_L1_error)}
  __pyx_t_11 = (__pyx_v_self->vessels[__pyx_v_vessel_index]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_11, 1);
  __pyx_t_12 = __pyx_v_index;
  __pyx_t_13 = -1;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_t_11.shape[0];
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_12 >= __pyx_t_11.shape[0])) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 1423, __pyx_L1_error)
  }
  __pyx_v_A0 = (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_11.data) + __pyx_t_12)) ))), 2.0));
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);

  /* "pylsewave/cynum.pyx":1424
 *         cdef double A0
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out[0] = A0             # <<<<<<<<<<<<<<
 *         out[1] = 0.0
 * 
 */
  __pyx_t_14 = 0;
  __pyx_t_13 = -1;
  if (__pyx_t_14 < 0) {
    __pyx_t_14 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_14 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_14 >= __pyx_v_out.shape[0])) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 1424, __pyx_L1_error)
  }
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_14)) )) = __pyx_v_A0;

  /* "pylsewave/cynum.pyx":1425
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 *         out[0] = A0
 *         out[1] = 0.0             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_t_15 = 1;
  __pyx_t_13 = -1;
  if (__pyx_t_15 < 0) {
    __pyx_t_15 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 0;
  } else if (unlikely(__pyx_t_15 >= __pyx_v_out.shape[0])) __pyx_t_13 = 0;
  if (unlikely(__pyx_t_13 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_13);
    __PYX_ERR(0, 1425, __pyx_L1_error)
  }
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_15)) )) = 0.0;

  /* "pylsewave/cynum.pyx":1421
 * 
 *     # @cython.boundscheck(False)
 *     cpdef void I(self, double x, int index, int vessel_index, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double A0
 *         A0 = M_PI*pow(self.vessels[vessel_index].r0[index], 2)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cBCs.I", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_5I(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_5I(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x;
  int __pyx_v_index;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("I (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_index,&__pyx_n_s_vessel_index,&__pyx_n_s_out,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_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("I", 1, 4, 4, 1); __PYX_ERR(0, 1421, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("I", 1, 4, 4, 2); __PYX_ERR(0, 1421, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("I", 1, 4, 4, 3); __PYX_ERR(0, 1421, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "I") < 0)) __PYX_ERR(0, 1421, __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 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1421, __pyx_L3_error)
    __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1421, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1421, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1421, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("I", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1421, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cBCs.I", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_4cBCs_4I(((struct __pyx_obj_9pylsewave_5cynum_cBCs *)__pyx_v_self), __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_4cBCs_4I(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, double __pyx_v_x, int __pyx_v_index, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("I", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 1421, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_4cBCs_I(__pyx_v_self, __pyx_v_x, __pyx_v_index, __pyx_v_vessel_index, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __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("pylsewave.cynum.cBCs.I", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1431
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_R(self, double[::1] x, double[::1] u,             # <<<<<<<<<<<<<<
 *                            double dt, int[::1] vessel_index_list, double[::1] out):
 *         cdef double x1, x2, x3, x4, x5, x6
 */

static int __pyx_f_9pylsewave_5cynum_4cBCs_bifurcation_R(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  double __pyx_v_x5;
  double __pyx_v_x6;
  int __pyx_v_p;
  int __pyx_v_d1;
  int __pyx_v_d2;
  double __pyx_v_A_p;
  double __pyx_v_q_p;
  double __pyx_v_A_d1;
  double __pyx_v_q_d1;
  double __pyx_v_A_d2;
  double __pyx_v_q_d2;
  double __pyx_v_rho_;
  Py_ssize_t __pyx_v_last_i;
  Py_ssize_t __pyx_v_first_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  double __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  double __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  double __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  double __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  double __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  double __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __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;
  __Pyx_memviewslice __pyx_t_26 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_27;
  __Pyx_memviewslice __pyx_t_28 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_29;
  __Pyx_memviewslice __pyx_t_30 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_31;
  __Pyx_memviewslice __pyx_t_32 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  __Pyx_RefNannySetupContext("bifurcation_R", 0);

  /* "pylsewave/cynum.pyx":1440
 *         cdef double w1, w2, x_i, W
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]             # <<<<<<<<<<<<<<
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]
 */
  __pyx_t_1 = 0;
  __pyx_t_2 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_1)) )));
  __pyx_t_3 = 1;
  __pyx_t_4 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_3)) )));
  __pyx_t_5 = 2;
  __pyx_t_6 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_5)) )));
  __pyx_t_7 = 3;
  __pyx_t_8 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_7)) )));
  __pyx_t_9 = 4;
  __pyx_t_10 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_9)) )));
  __pyx_t_11 = 5;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_11)) )));
  __pyx_v_x1 = __pyx_t_2;
  __pyx_v_x2 = __pyx_t_4;
  __pyx_v_x3 = __pyx_t_6;
  __pyx_v_x4 = __pyx_t_8;
  __pyx_v_x5 = __pyx_t_10;
  __pyx_v_x6 = __pyx_t_12;

  /* "pylsewave/cynum.pyx":1441
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]             # <<<<<<<<<<<<<<
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]
 *         rho_ = self._rho
 */
  __pyx_t_13 = 0;
  __pyx_t_14 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_13)) )));
  __pyx_t_15 = 1;
  __pyx_t_16 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_15)) )));
  __pyx_t_17 = 2;
  __pyx_t_18 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_17)) )));
  __pyx_v_p = __pyx_t_14;
  __pyx_v_d1 = __pyx_t_16;
  __pyx_v_d2 = __pyx_t_18;

  /* "pylsewave/cynum.pyx":1442
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]             # <<<<<<<<<<<<<<
 *         rho_ = self._rho
 * 
 */
  __pyx_t_19 = 0;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_19)) )));
  __pyx_t_20 = 1;
  __pyx_t_10 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_20)) )));
  __pyx_t_21 = 2;
  __pyx_t_8 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_21)) )));
  __pyx_t_22 = 3;
  __pyx_t_6 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_22)) )));
  __pyx_t_23 = 4;
  __pyx_t_4 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_23)) )));
  __pyx_t_24 = 5;
  __pyx_t_2 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_24)) )));
  __pyx_v_A_p = __pyx_t_12;
  __pyx_v_q_p = __pyx_t_10;
  __pyx_v_A_d1 = __pyx_t_8;
  __pyx_v_q_d1 = __pyx_t_6;
  __pyx_v_A_d2 = __pyx_t_4;
  __pyx_v_q_d2 = __pyx_t_2;

  /* "pylsewave/cynum.pyx":1443
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]
 *         rho_ = self._rho             # <<<<<<<<<<<<<<
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 */
  __pyx_t_2 = __pyx_v_self->_rho;
  __pyx_v_rho_ = __pyx_t_2;

  /* "pylsewave/cynum.pyx":1445
 *         rho_ = self._rho
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 *         first_i = 0
 * 
 */
  __pyx_v_last_i = (((__pyx_v_self->vessels[__pyx_v_p]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1446
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 *         first_i = 0             # <<<<<<<<<<<<<<
 * 
 *         out[0] = -x2 + x4 + x6
 */
  __pyx_v_first_i = 0;

  /* "pylsewave/cynum.pyx":1448
 *         first_i = 0
 * 
 *         out[0] = -x2 + x4 + x6             # <<<<<<<<<<<<<<
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 */
  __pyx_t_25 = 0;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_25)) )) = (((-__pyx_v_x2) + __pyx_v_x4) + __pyx_v_x6);

  /* "pylsewave/cynum.pyx":1449
 * 
 *         out[0] = -x2 + x4 + x6
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 */
  __pyx_t_26 = (__pyx_v_self->vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_26, 1);
  __pyx_t_27 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1450
 *         out[0] = -x2 + x4 + x6
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +             # <<<<<<<<<<<<<<
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 */
  __pyx_t_28 = (__pyx_v_self->vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
  __pyx_t_29 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1451
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))             # <<<<<<<<<<<<<<
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +
 */
  __pyx_t_30 = (__pyx_v_self->vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_31 = __pyx_v_first_i;
  __pyx_t_32 = (__pyx_v_self->vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_33 = 0;

  /* "pylsewave/cynum.pyx":1449
 * 
 *         out[0] = -x2 + x4 + x6
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 */
  __pyx_t_34 = 1;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_34)) )) = (((((-0.5 * __pyx_v_rho_) * pow((__pyx_v_x2 / __pyx_v_x1), 2.0)) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_26.data) + __pyx_t_27)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_28.data) + __pyx_t_29)) ))), 2.0)) / __pyx_v_x1))))) + ((0.5 * __pyx_v_rho_) * pow((__pyx_v_x4 / __pyx_v_x3), 2.0))) + ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_31)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_33)) ))), 2.0)) / __pyx_v_x3)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);

  /* "pylsewave/cynum.pyx":1452
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x5)))
 */
  __pyx_t_32 = (__pyx_v_self->vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_35 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1453
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +             # <<<<<<<<<<<<<<
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x5)))
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +
 */
  __pyx_t_30 = (__pyx_v_self->vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_36 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1454
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x5)))             # <<<<<<<<<<<<<<
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +
 *                   (q_p/A_p + 4*self.pdes.compute_c_i(A_p, index=last_i-1, vessel_index=p)))
 */
  __pyx_t_28 = (__pyx_v_self->vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
  __pyx_t_37 = 0;
  __pyx_t_26 = (__pyx_v_self->vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_26, 1);
  __pyx_t_38 = 0;

  /* "pylsewave/cynum.pyx":1452
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x5)))
 */
  __pyx_t_39 = 2;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_39)) )) = (((((-0.5 * __pyx_v_rho_) * pow((__pyx_v_x2 / __pyx_v_x1), 2.0)) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_35)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_36)) ))), 2.0)) / __pyx_v_x1))))) + ((0.5 * __pyx_v_rho_) * pow((__pyx_v_x6 / __pyx_v_x5), 2.0))) + ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_28.data) + __pyx_t_37)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_26.data) + __pyx_t_38)) ))), 2.0)) / __pyx_v_x5)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);

  /* "pylsewave/cynum.pyx":1455
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x5)))
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +             # <<<<<<<<<<<<<<
 *                   (q_p/A_p + 4*self.pdes.compute_c_i(A_p, index=last_i-1, vessel_index=p)))
 *         out[4] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d1) +
 */
  __pyx_t_40 = 3;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_40)) )) = ((((-__pyx_v_x2) / __pyx_v_x1) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->pdes, __pyx_v_x1, __pyx_v_last_i, __pyx_v_p, 0))) + ((__pyx_v_q_p / __pyx_v_A_p) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->pdes, __pyx_v_A_p, (__pyx_v_last_i - 1), __pyx_v_p, 0))));

  /* "pylsewave/cynum.pyx":1457
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +
 *                   (q_p/A_p + 4*self.pdes.compute_c_i(A_p, index=last_i-1, vessel_index=p)))
 *         out[4] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d1) +             # <<<<<<<<<<<<<<
 *                   (q_d1/A_d1 - 4*self.pdes.compute_c_i(A_d1, index=1, vessel_index=d1)))
 *         out[5] = (-x6/x5 + 4*self.pdes.compute_c_i(x5, index=0, vessel_index=d2) +
 */
  __pyx_t_41 = 4;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_41)) )) = ((((-__pyx_v_x4) / __pyx_v_x3) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->pdes, __pyx_v_x3, 0, __pyx_v_d1, 0))) + ((__pyx_v_q_d1 / __pyx_v_A_d1) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->pdes, __pyx_v_A_d1, 1, __pyx_v_d1, 0))));

  /* "pylsewave/cynum.pyx":1459
 *         out[4] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d1) +
 *                   (q_d1/A_d1 - 4*self.pdes.compute_c_i(A_d1, index=1, vessel_index=d1)))
 *         out[5] = (-x6/x5 + 4*self.pdes.compute_c_i(x5, index=0, vessel_index=d2) +             # <<<<<<<<<<<<<<
 *                   (q_d2/A_d2 - 4*self.pdes.compute_c_i(A_d2, index=1, vessel_index=d2)))
 * 
 */
  __pyx_t_42 = 5;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_42)) )) = ((((-__pyx_v_x6) / __pyx_v_x5) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->pdes, __pyx_v_x5, 0, __pyx_v_d2, 0))) + ((__pyx_v_q_d2 / __pyx_v_A_d2) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->pdes, __pyx_v_A_d2, 1, __pyx_v_d2, 0))));

  /* "pylsewave/cynum.pyx":1462
 *                   (q_d2/A_d2 - 4*self.pdes.compute_c_i(A_d2, index=1, vessel_index=d2)))
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1431
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_R(self, double[::1] x, double[::1] u,             # <<<<<<<<<<<<<<
 *                            double dt, int[::1] vessel_index_list, double[::1] out):
 *         cdef double x1, x2, x3, x4, x5, x6
 */

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

/* "pylsewave/cynum.pyx":1468
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_Jr(self, double[::1] x, int[::1] vessel_index_list,             # <<<<<<<<<<<<<<
 *                             double[:, ::1] out):
 *         cdef double x1, x2, x3, x4, x5, x6, rho_
 */

static int __pyx_f_9pylsewave_5cynum_4cBCs_bifurcation_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  double __pyx_v_x5;
  double __pyx_v_x6;
  double __pyx_v_rho_;
  int __pyx_v_p;
  int __pyx_v_d1;
  int __pyx_v_d2;
  Py_ssize_t __pyx_v_last_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_first_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  double __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  double __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  double __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  double __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  double __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  double __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __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;
  Py_ssize_t __pyx_t_30;
  __Pyx_memviewslice __pyx_t_31 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_32;
  __Pyx_memviewslice __pyx_t_33 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  Py_ssize_t __pyx_t_64;
  Py_ssize_t __pyx_t_65;
  Py_ssize_t __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  Py_ssize_t __pyx_t_70;
  Py_ssize_t __pyx_t_71;
  Py_ssize_t __pyx_t_72;
  Py_ssize_t __pyx_t_73;
  Py_ssize_t __pyx_t_74;
  Py_ssize_t __pyx_t_75;
  Py_ssize_t __pyx_t_76;
  Py_ssize_t __pyx_t_77;
  Py_ssize_t __pyx_t_78;
  Py_ssize_t __pyx_t_79;
  Py_ssize_t __pyx_t_80;
  Py_ssize_t __pyx_t_81;
  Py_ssize_t __pyx_t_82;
  Py_ssize_t __pyx_t_83;
  Py_ssize_t __pyx_t_84;
  Py_ssize_t __pyx_t_85;
  Py_ssize_t __pyx_t_86;
  Py_ssize_t __pyx_t_87;
  Py_ssize_t __pyx_t_88;
  Py_ssize_t __pyx_t_89;
  Py_ssize_t __pyx_t_90;
  Py_ssize_t __pyx_t_91;
  Py_ssize_t __pyx_t_92;
  Py_ssize_t __pyx_t_93;
  Py_ssize_t __pyx_t_94;
  Py_ssize_t __pyx_t_95;
  Py_ssize_t __pyx_t_96;
  Py_ssize_t __pyx_t_97;
  Py_ssize_t __pyx_t_98;
  Py_ssize_t __pyx_t_99;
  Py_ssize_t __pyx_t_100;
  Py_ssize_t __pyx_t_101;
  Py_ssize_t __pyx_t_102;
  Py_ssize_t __pyx_t_103;
  Py_ssize_t __pyx_t_104;
  Py_ssize_t __pyx_t_105;
  Py_ssize_t __pyx_t_106;
  __Pyx_RefNannySetupContext("bifurcation_Jr", 0);

  /* "pylsewave/cynum.pyx":1474
 *         cdef Py_ssize_t last_i, first_i
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]             # <<<<<<<<<<<<<<
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 * 
 */
  __pyx_t_1 = 0;
  __pyx_t_2 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_1)) )));
  __pyx_t_3 = 1;
  __pyx_t_4 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_3)) )));
  __pyx_t_5 = 2;
  __pyx_t_6 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_5)) )));
  __pyx_t_7 = 3;
  __pyx_t_8 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_7)) )));
  __pyx_t_9 = 4;
  __pyx_t_10 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_9)) )));
  __pyx_t_11 = 5;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_11)) )));
  __pyx_v_x1 = __pyx_t_2;
  __pyx_v_x2 = __pyx_t_4;
  __pyx_v_x3 = __pyx_t_6;
  __pyx_v_x4 = __pyx_t_8;
  __pyx_v_x5 = __pyx_t_10;
  __pyx_v_x6 = __pyx_t_12;

  /* "pylsewave/cynum.pyx":1475
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]             # <<<<<<<<<<<<<<
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 */
  __pyx_t_13 = 0;
  __pyx_t_14 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_13)) )));
  __pyx_t_15 = 1;
  __pyx_t_16 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_15)) )));
  __pyx_t_17 = 2;
  __pyx_t_18 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_17)) )));
  __pyx_v_p = __pyx_t_14;
  __pyx_v_d1 = __pyx_t_16;
  __pyx_v_d2 = __pyx_t_18;

  /* "pylsewave/cynum.pyx":1477
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 *         first_i = 0
 * 
 */
  __pyx_v_last_i = (((__pyx_v_self->vessels[__pyx_v_p]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1478
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 *         first_i = 0             # <<<<<<<<<<<<<<
 * 
 *         rho_ = self._rho
 */
  __pyx_v_first_i = 0;

  /* "pylsewave/cynum.pyx":1480
 *         first_i = 0
 * 
 *         rho_ = self._rho             # <<<<<<<<<<<<<<
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.
 */
  __pyx_t_12 = __pyx_v_self->_rho;
  __pyx_v_rho_ = __pyx_t_12;

  /* "pylsewave/cynum.pyx":1481
 * 
 *         rho_ = self._rho
 *         out[0, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 */
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) )) + __pyx_t_20)) )) = 0.;

  /* "pylsewave/cynum.pyx":1482
 *         rho_ = self._rho
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.             # <<<<<<<<<<<<<<
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 */
  __pyx_t_21 = 0;
  __pyx_t_22 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_21 * __pyx_v_out.strides[0]) )) + __pyx_t_22)) )) = -1.;

  /* "pylsewave/cynum.pyx":1483
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 3] = 1.
 *         out[0, 4] = 0.
 */
  __pyx_t_23 = 0;
  __pyx_t_24 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_23 * __pyx_v_out.strides[0]) )) + __pyx_t_24)) )) = 0.;

  /* "pylsewave/cynum.pyx":1484
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.             # <<<<<<<<<<<<<<
 *         out[0, 4] = 0.
 *         out[0, 5] = 1.
 */
  __pyx_t_25 = 0;
  __pyx_t_26 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_25 * __pyx_v_out.strides[0]) )) + __pyx_t_26)) )) = 1.;

  /* "pylsewave/cynum.pyx":1485
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 *         out[0, 4] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 5] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 */
  __pyx_t_27 = 0;
  __pyx_t_28 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_27 * __pyx_v_out.strides[0]) )) + __pyx_t_28)) )) = 0.;

  /* "pylsewave/cynum.pyx":1486
 *         out[0, 3] = 1.
 *         out[0, 4] = 0.
 *         out[0, 5] = 1.             # <<<<<<<<<<<<<<
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2
 */
  __pyx_t_29 = 0;
  __pyx_t_30 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_29 * __pyx_v_out.strides[0]) )) + __pyx_t_30)) )) = 1.;

  /* "pylsewave/cynum.pyx":1487
 *         out[0, 4] = 0.
 *         out[0, 5] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))             # <<<<<<<<<<<<<<
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d1].f_r0[0]*(M_PI*self.vessels[d1].r0[0]**2)**0.5 / (2*x3**(3/2.))
 */
  __pyx_t_31 = (__pyx_v_self->vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_32 = __pyx_v_last_i;
  __pyx_t_33 = (__pyx_v_self->vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_34 = __pyx_v_last_i;
  __pyx_t_35 = 1;
  __pyx_t_36 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_35 * __pyx_v_out.strides[0]) )) + __pyx_t_36)) )) = ((__pyx_v_rho_ * (pow(__pyx_v_x2, 2.0) / pow(__pyx_v_x1, 3.0))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_32)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_34)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x1, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1488
 *         out[0, 5] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2             # <<<<<<<<<<<<<<
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d1].f_r0[0]*(M_PI*self.vessels[d1].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2
 */
  __pyx_t_37 = 1;
  __pyx_t_38 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_37 * __pyx_v_out.strides[0]) )) + __pyx_t_38)) )) = (((-__pyx_v_rho_) * __pyx_v_x2) / pow(__pyx_v_x1, 2.0));

  /* "pylsewave/cynum.pyx":1489
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d1].f_r0[0]*(M_PI*self.vessels[d1].r0[0]**2)**0.5 / (2*x3**(3/2.))             # <<<<<<<<<<<<<<
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[1, 4] = 0.
 */
  __pyx_t_33 = (__pyx_v_self->vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_39 = 0;
  __pyx_t_31 = (__pyx_v_self->vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_40 = 0;
  __pyx_t_41 = 1;
  __pyx_t_42 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_41 * __pyx_v_out.strides[0]) )) + __pyx_t_42)) )) = (((-__pyx_v_rho_) * (pow(__pyx_v_x4, 2.0) / pow(__pyx_v_x3, 3.0))) + (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_39)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_40)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x3, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);

  /* "pylsewave/cynum.pyx":1490
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d1].f_r0[0]*(M_PI*self.vessels[d1].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2             # <<<<<<<<<<<<<<
 *         out[1, 4] = 0.
 *         out[1, 5] = 0.
 */
  __pyx_t_43 = 1;
  __pyx_t_44 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_43 * __pyx_v_out.strides[0]) )) + __pyx_t_44)) )) = ((__pyx_v_rho_ * __pyx_v_x4) / pow(__pyx_v_x3, 2.0));

  /* "pylsewave/cynum.pyx":1491
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d1].f_r0[0]*(M_PI*self.vessels[d1].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[1, 4] = 0.             # <<<<<<<<<<<<<<
 *         out[1, 5] = 0.
 *         out[2, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 */
  __pyx_t_45 = 1;
  __pyx_t_46 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_45 * __pyx_v_out.strides[0]) )) + __pyx_t_46)) )) = 0.;

  /* "pylsewave/cynum.pyx":1492
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[1, 4] = 0.
 *         out[1, 5] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[2, 1] = -rho_*x2 / x1**2
 */
  __pyx_t_47 = 1;
  __pyx_t_48 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_47 * __pyx_v_out.strides[0]) )) + __pyx_t_48)) )) = 0.;

  /* "pylsewave/cynum.pyx":1493
 *         out[1, 4] = 0.
 *         out[1, 5] = 0.
 *         out[2, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))             # <<<<<<<<<<<<<<
 *         out[2, 1] = -rho_*x2 / x1**2
 *         out[2, 2] = 0.
 */
  __pyx_t_31 = (__pyx_v_self->vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_49 = __pyx_v_last_i;
  __pyx_t_33 = (__pyx_v_self->vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_50 = __pyx_v_last_i;
  __pyx_t_51 = 2;
  __pyx_t_52 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_51 * __pyx_v_out.strides[0]) )) + __pyx_t_52)) )) = ((__pyx_v_rho_ * (pow(__pyx_v_x2, 2.0) / pow(__pyx_v_x1, 3.0))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_49)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_50)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x1, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1494
 *         out[1, 5] = 0.
 *         out[2, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[2, 1] = -rho_*x2 / x1**2             # <<<<<<<<<<<<<<
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 */
  __pyx_t_53 = 2;
  __pyx_t_54 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_53 * __pyx_v_out.strides[0]) )) + __pyx_t_54)) )) = (((-__pyx_v_rho_) * __pyx_v_x2) / pow(__pyx_v_x1, 2.0));

  /* "pylsewave/cynum.pyx":1495
 *         out[2, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[2, 1] = -rho_*x2 / x1**2
 *         out[2, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 3] = 0.
 *         out[2, 4] = -rho_*(x6**2 / x5**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x5**(3/2.))
 */
  __pyx_t_55 = 2;
  __pyx_t_56 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_55 * __pyx_v_out.strides[0]) )) + __pyx_t_56)) )) = 0.;

  /* "pylsewave/cynum.pyx":1496
 *         out[2, 1] = -rho_*x2 / x1**2
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 4] = -rho_*(x6**2 / x5**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x5**(3/2.))
 *         out[2, 5] = rho_*x6 / x5**2
 */
  __pyx_t_57 = 2;
  __pyx_t_58 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_57 * __pyx_v_out.strides[0]) )) + __pyx_t_58)) )) = 0.;

  /* "pylsewave/cynum.pyx":1497
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 *         out[2, 4] = -rho_*(x6**2 / x5**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x5**(3/2.))             # <<<<<<<<<<<<<<
 *         out[2, 5] = rho_*x6 / x5**2
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[p].f_r0[last_i]*sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-5/4.)
 */
  __pyx_t_33 = (__pyx_v_self->vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_59 = 0;
  __pyx_t_31 = (__pyx_v_self->vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_60 = 0;
  __pyx_t_61 = 2;
  __pyx_t_62 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_61 * __pyx_v_out.strides[0]) )) + __pyx_t_62)) )) = (((-__pyx_v_rho_) * (pow(__pyx_v_x6, 2.0) / pow(__pyx_v_x5, 3.0))) + (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_59)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_60)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x5, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);

  /* "pylsewave/cynum.pyx":1498
 *         out[2, 3] = 0.
 *         out[2, 4] = -rho_*(x6**2 / x5**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x5**(3/2.))
 *         out[2, 5] = rho_*x6 / x5**2             # <<<<<<<<<<<<<<
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[p].f_r0[last_i]*sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-5/4.)
 *         out[3, 1] = -1./x1
 */
  __pyx_t_63 = 2;
  __pyx_t_64 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_63 * __pyx_v_out.strides[0]) )) + __pyx_t_64)) )) = ((__pyx_v_rho_ * __pyx_v_x6) / pow(__pyx_v_x5, 2.0));

  /* "pylsewave/cynum.pyx":1499
 *         out[2, 4] = -rho_*(x6**2 / x5**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x5**(3/2.))
 *         out[2, 5] = rho_*x6 / x5**2
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[p].f_r0[last_i]*sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-5/4.)             # <<<<<<<<<<<<<<
 *         out[3, 1] = -1./x1
 *         out[3, 2] = 0.
 */
  __pyx_t_31 = (__pyx_v_self->vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_65 = __pyx_v_last_i;
  __pyx_t_33 = (__pyx_v_self->vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_66 = __pyx_v_last_i;
  __pyx_t_67 = 3;
  __pyx_t_68 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_67 * __pyx_v_out.strides[0]) )) + __pyx_t_68)) )) = ((__pyx_v_x2 / pow(__pyx_v_x1, 2.0)) - ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_rho_) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_65)) )))) * sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_66)) ))), 2.0))))))) * pow(__pyx_v_x1, (-5.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1500
 *         out[2, 5] = rho_*x6 / x5**2
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[p].f_r0[last_i]*sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-5/4.)
 *         out[3, 1] = -1./x1             # <<<<<<<<<<<<<<
 *         out[3, 2] = 0.
 *         out[3, 3] = 0.0
 */
  __pyx_t_69 = 3;
  __pyx_t_70 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_69 * __pyx_v_out.strides[0]) )) + __pyx_t_70)) )) = (-1. / __pyx_v_x1);

  /* "pylsewave/cynum.pyx":1501
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[p].f_r0[last_i]*sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-5/4.)
 *         out[3, 1] = -1./x1
 *         out[3, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 3] = 0.0
 *         out[3, 4] = 0.
 */
  __pyx_t_71 = 3;
  __pyx_t_72 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_71 * __pyx_v_out.strides[0]) )) + __pyx_t_72)) )) = 0.;

  /* "pylsewave/cynum.pyx":1502
 *         out[3, 1] = -1./x1
 *         out[3, 2] = 0.
 *         out[3, 3] = 0.0             # <<<<<<<<<<<<<<
 *         out[3, 4] = 0.
 *         out[3, 5] = 0.
 */
  __pyx_t_73 = 3;
  __pyx_t_74 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_73 * __pyx_v_out.strides[0]) )) + __pyx_t_74)) )) = 0.0;

  /* "pylsewave/cynum.pyx":1503
 *         out[3, 2] = 0.
 *         out[3, 3] = 0.0
 *         out[3, 4] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 5] = 0.
 *         out[4, 0] = 0.0
 */
  __pyx_t_75 = 3;
  __pyx_t_76 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_75 * __pyx_v_out.strides[0]) )) + __pyx_t_76)) )) = 0.;

  /* "pylsewave/cynum.pyx":1504
 *         out[3, 3] = 0.0
 *         out[3, 4] = 0.
 *         out[3, 5] = 0.             # <<<<<<<<<<<<<<
 *         out[4, 0] = 0.0
 *         out[4, 1] = 0.
 */
  __pyx_t_77 = 3;
  __pyx_t_78 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_77 * __pyx_v_out.strides[0]) )) + __pyx_t_78)) )) = 0.;

  /* "pylsewave/cynum.pyx":1505
 *         out[3, 4] = 0.
 *         out[3, 5] = 0.
 *         out[4, 0] = 0.0             # <<<<<<<<<<<<<<
 *         out[4, 1] = 0.
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[0]*sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-5/4.)
 */
  __pyx_t_79 = 4;
  __pyx_t_80 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_79 * __pyx_v_out.strides[0]) )) + __pyx_t_80)) )) = 0.0;

  /* "pylsewave/cynum.pyx":1506
 *         out[3, 5] = 0.
 *         out[4, 0] = 0.0
 *         out[4, 1] = 0.             # <<<<<<<<<<<<<<
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[0]*sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-5/4.)
 *         out[4, 3] = -1./x3
 */
  __pyx_t_81 = 4;
  __pyx_t_82 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_81 * __pyx_v_out.strides[0]) )) + __pyx_t_82)) )) = 0.;

  /* "pylsewave/cynum.pyx":1507
 *         out[4, 0] = 0.0
 *         out[4, 1] = 0.
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[0]*sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-5/4.)             # <<<<<<<<<<<<<<
 *         out[4, 3] = -1./x3
 *         out[4, 4] = 0.
 */
  __pyx_t_33 = (__pyx_v_self->vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_83 = 0;
  __pyx_t_31 = (__pyx_v_self->vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_84 = 0;
  __pyx_t_85 = 4;
  __pyx_t_86 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_85 * __pyx_v_out.strides[0]) )) + __pyx_t_86)) )) = ((__pyx_v_x4 / pow(__pyx_v_x3, 2.0)) + ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_rho_) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_83)) )))) * sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_84)) ))), 2.0))))))) * pow(__pyx_v_x3, (-5.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);

  /* "pylsewave/cynum.pyx":1508
 *         out[4, 1] = 0.
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[0]*sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-5/4.)
 *         out[4, 3] = -1./x3             # <<<<<<<<<<<<<<
 *         out[4, 4] = 0.
 *         out[4, 5] = 0.
 */
  __pyx_t_87 = 4;
  __pyx_t_88 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_87 * __pyx_v_out.strides[0]) )) + __pyx_t_88)) )) = (-1. / __pyx_v_x3);

  /* "pylsewave/cynum.pyx":1509
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[0]*sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-5/4.)
 *         out[4, 3] = -1./x3
 *         out[4, 4] = 0.             # <<<<<<<<<<<<<<
 *         out[4, 5] = 0.
 *         out[5, 0] = 0.
 */
  __pyx_t_89 = 4;
  __pyx_t_90 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_89 * __pyx_v_out.strides[0]) )) + __pyx_t_90)) )) = 0.;

  /* "pylsewave/cynum.pyx":1510
 *         out[4, 3] = -1./x3
 *         out[4, 4] = 0.
 *         out[4, 5] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 0] = 0.
 *         out[5, 1] = 0.
 */
  __pyx_t_91 = 4;
  __pyx_t_92 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_91 * __pyx_v_out.strides[0]) )) + __pyx_t_92)) )) = 0.;

  /* "pylsewave/cynum.pyx":1511
 *         out[4, 4] = 0.
 *         out[4, 5] = 0.
 *         out[5, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 1] = 0.
 *         out[5, 2] = 0.
 */
  __pyx_t_93 = 5;
  __pyx_t_94 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_93 * __pyx_v_out.strides[0]) )) + __pyx_t_94)) )) = 0.;

  /* "pylsewave/cynum.pyx":1512
 *         out[4, 5] = 0.
 *         out[5, 0] = 0.
 *         out[5, 1] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 2] = 0.
 *         out[5, 3] = 0.
 */
  __pyx_t_95 = 5;
  __pyx_t_96 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_95 * __pyx_v_out.strides[0]) )) + __pyx_t_96)) )) = 0.;

  /* "pylsewave/cynum.pyx":1513
 *         out[5, 0] = 0.
 *         out[5, 1] = 0.
 *         out[5, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 3] = 0.
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-5/4.)
 */
  __pyx_t_97 = 5;
  __pyx_t_98 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_97 * __pyx_v_out.strides[0]) )) + __pyx_t_98)) )) = 0.;

  /* "pylsewave/cynum.pyx":1514
 *         out[5, 1] = 0.
 *         out[5, 2] = 0.
 *         out[5, 3] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-5/4.)
 *         out[5, 5] = -1./x5
 */
  __pyx_t_99 = 5;
  __pyx_t_100 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_99 * __pyx_v_out.strides[0]) )) + __pyx_t_100)) )) = 0.;

  /* "pylsewave/cynum.pyx":1515
 *         out[5, 2] = 0.
 *         out[5, 3] = 0.
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-5/4.)             # <<<<<<<<<<<<<<
 *         out[5, 5] = -1./x5
 * 
 */
  __pyx_t_31 = (__pyx_v_self->vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_101 = 0;
  __pyx_t_33 = (__pyx_v_self->vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_102 = 0;
  __pyx_t_103 = 5;
  __pyx_t_104 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_103 * __pyx_v_out.strides[0]) )) + __pyx_t_104)) )) = ((__pyx_v_x6 / pow(__pyx_v_x5, 2.0)) + ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_rho_) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_101)) )))) * sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_102)) ))), 2.0))))))) * pow(__pyx_v_x5, (-5.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1516
 *         out[5, 3] = 0.
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-5/4.)
 *         out[5, 5] = -1./x5             # <<<<<<<<<<<<<<
 * 
 *         return STATUS_OK
 */
  __pyx_t_105 = 5;
  __pyx_t_106 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_105 * __pyx_v_out.strides[0]) )) + __pyx_t_106)) )) = (-1. / __pyx_v_x5);

  /* "pylsewave/cynum.pyx":1518
 *         out[5, 5] = -1./x5
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1468
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_Jr(self, double[::1] x, int[::1] vessel_index_list,             # <<<<<<<<<<<<<<
 *                             double[:, ::1] out):
 *         cdef double x1, x2, x3, x4, x5, x6, rho_
 */

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

/* "pylsewave/cynum.pyx":1524
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_R(self, double[::1] x, double[::1] u, double dt, int[::1] vessel_index_list, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef double A_d1, q_d1, A_d2, q_d2
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_7conjuction_R(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9pylsewave_5cynum_4cBCs_conjuction_R(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  double __pyx_v_rho_;
  double __pyx_v_A_d1;
  double __pyx_v_q_d1;
  double __pyx_v_A_d2;
  double __pyx_v_q_d2;
  int __pyx_v_d1;
  int __pyx_v_d2;
  Py_ssize_t __pyx_v_last_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_first_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  double __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  double __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  double __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  double __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  int __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;
  __Pyx_memviewslice __pyx_t_29 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_30;
  __Pyx_memviewslice __pyx_t_31 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_32;
  __Pyx_memviewslice __pyx_t_33 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_34;
  __Pyx_memviewslice __pyx_t_35 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  __Pyx_RefNannySetupContext("conjuction_R", 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_conjuction_R); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_4cBCs_7conjuction_R)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_u, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_vessel_index_list, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_out, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1524, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_12;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":1531
 *         cdef double w1, w2, x_i, W
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]             # <<<<<<<<<<<<<<
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]
 * 
 */
  __pyx_t_13 = 0;
  __pyx_t_14 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_13)) )));
  __pyx_t_15 = 1;
  __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_15)) )));
  __pyx_t_17 = 2;
  __pyx_t_18 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_17)) )));
  __pyx_t_19 = 3;
  __pyx_t_20 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_19)) )));
  __pyx_v_x1 = __pyx_t_14;
  __pyx_v_x2 = __pyx_t_16;
  __pyx_v_x3 = __pyx_t_18;
  __pyx_v_x4 = __pyx_t_20;

  /* "pylsewave/cynum.pyx":1532
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]             # <<<<<<<<<<<<<<
 * 
 *         #this is better to be improved and instead of shape - 1, last index should be shape
 */
  __pyx_t_21 = 0;
  __pyx_t_12 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_21)) )));
  __pyx_t_22 = 1;
  __pyx_t_23 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_22)) )));
  __pyx_v_d1 = __pyx_t_12;
  __pyx_v_d2 = __pyx_t_23;

  /* "pylsewave/cynum.pyx":1535
 * 
 *         #this is better to be improved and instead of shape - 1, last index should be shape
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 *         first_i = 0
 * 
 */
  __pyx_v_last_i = (((__pyx_v_self->vessels[__pyx_v_d1]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1536
 *         #this is better to be improved and instead of shape - 1, last index should be shape
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1
 *         first_i = 0             # <<<<<<<<<<<<<<
 * 
 *         A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3]
 */
  __pyx_v_first_i = 0;

  /* "pylsewave/cynum.pyx":1538
 *         first_i = 0
 * 
 *         A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3]             # <<<<<<<<<<<<<<
 *         rho_ = self._rho
 * 
 */
  __pyx_t_24 = 0;
  __pyx_t_20 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_24)) )));
  __pyx_t_25 = 1;
  __pyx_t_18 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_25)) )));
  __pyx_t_26 = 2;
  __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_26)) )));
  __pyx_t_27 = 3;
  __pyx_t_14 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_27)) )));
  __pyx_v_A_d1 = __pyx_t_20;
  __pyx_v_q_d1 = __pyx_t_18;
  __pyx_v_A_d2 = __pyx_t_16;
  __pyx_v_q_d2 = __pyx_t_14;

  /* "pylsewave/cynum.pyx":1539
 * 
 *         A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3]
 *         rho_ = self._rho             # <<<<<<<<<<<<<<
 * 
 *         out[0] = -x2 + x4
 */
  __pyx_t_14 = __pyx_v_self->_rho;
  __pyx_v_rho_ = __pyx_t_14;

  /* "pylsewave/cynum.pyx":1541
 *         rho_ = self._rho
 * 
 *         out[0] = -x2 + x4             # <<<<<<<<<<<<<<
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 */
  __pyx_t_28 = 0;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_28)) )) = ((-__pyx_v_x2) + __pyx_v_x4);

  /* "pylsewave/cynum.pyx":1542
 * 
 *         out[0] = -x2 + x4
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x3)))
 */
  __pyx_t_29 = (__pyx_v_self->vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_29, 1);
  __pyx_t_30 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1543
 *         out[0] = -x2 + x4
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +             # <<<<<<<<<<<<<<
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x3)))
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +
 */
  __pyx_t_31 = (__pyx_v_self->vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_32 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1544
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x3)))             # <<<<<<<<<<<<<<
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +
 *                   (q_d1/A_d1 + 4*self.pdes.compute_c_i(A_d1, index=last_i-1, vessel_index=d1)))
 */
  __pyx_t_33 = (__pyx_v_self->vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_34 = 0;
  __pyx_t_35 = (__pyx_v_self->vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_35, 1);
  __pyx_t_36 = 0;

  /* "pylsewave/cynum.pyx":1542
 * 
 *         out[0] = -x2 + x4
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x3)))
 */
  __pyx_t_37 = 1;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_37)) )) = (((((-0.5 * __pyx_v_rho_) * pow((__pyx_v_x2 / __pyx_v_x1), 2.0)) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_29.data) + __pyx_t_30)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_32)) ))), 2.0)) / __pyx_v_x1))))) + ((0.5 * __pyx_v_rho_) * pow((__pyx_v_x4 / __pyx_v_x3), 2.0))) + ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_34)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_35.data) + __pyx_t_36)) ))), 2.0)) / __pyx_v_x3)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_29, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1);

  /* "pylsewave/cynum.pyx":1545
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x3)))
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +             # <<<<<<<<<<<<<<
 *                   (q_d1/A_d1 + 4*self.pdes.compute_c_i(A_d1, index=last_i-1, vessel_index=d1)))
 *         out[3] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d2) +
 */
  __pyx_t_38 = 2;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_38)) )) = ((((-__pyx_v_x2) / __pyx_v_x1) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->pdes, __pyx_v_x1, __pyx_v_last_i, __pyx_v_d1, 0))) + ((__pyx_v_q_d1 / __pyx_v_A_d1) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->pdes, __pyx_v_A_d1, (__pyx_v_last_i - 1), __pyx_v_d1, 0))));

  /* "pylsewave/cynum.pyx":1547
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +
 *                   (q_d1/A_d1 + 4*self.pdes.compute_c_i(A_d1, index=last_i-1, vessel_index=d1)))
 *         out[3] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d2) +             # <<<<<<<<<<<<<<
 *                   (q_d2/A_d2 - 4*self.pdes.compute_c_i(A_d2, index=1, vessel_index=d2)))
 * 
 */
  __pyx_t_39 = 3;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_39)) )) = ((((-__pyx_v_x4) / __pyx_v_x3) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->pdes, __pyx_v_x3, 0, __pyx_v_d2, 0))) + ((__pyx_v_q_d2 / __pyx_v_A_d2) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->pdes, __pyx_v_A_d2, 1, __pyx_v_d2, 0))));

  /* "pylsewave/cynum.pyx":1551
 * 
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1524
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_R(self, double[::1] x, double[::1] u, double dt, int[::1] vessel_index_list, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef double A_d1, q_d1, A_d2, q_d2
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __PYX_XDEC_MEMVIEW(&__pyx_t_29, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cBCs.conjuction_R", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_7conjuction_R(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_7conjuction_R(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_dt;
  __Pyx_memviewslice __pyx_v_vessel_index_list = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("conjuction_R (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_u,&__pyx_n_s_dt,&__pyx_n_s_vessel_index_list,&__pyx_n_s_out,0};
    PyObject* values[5] = {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  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_u)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 1); __PYX_ERR(0, 1524, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 2); __PYX_ERR(0, 1524, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index_list)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 3); __PYX_ERR(0, 1524, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 4); __PYX_ERR(0, 1524, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conjuction_R") < 0)) __PYX_ERR(0, 1524, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
    }
    __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1524, __pyx_L3_error)
    __pyx_v_u = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 1524, __pyx_L3_error)
    __pyx_v_dt = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1524, __pyx_L3_error)
    __pyx_v_vessel_index_list = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[3]); if (unlikely(!__pyx_v_vessel_index_list.memview)) __PYX_ERR(0, 1524, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[4]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1524, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1524, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cBCs.conjuction_R", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_4cBCs_6conjuction_R(((struct __pyx_obj_9pylsewave_5cynum_cBCs *)__pyx_v_self), __pyx_v_x, __pyx_v_u, __pyx_v_dt, __pyx_v_vessel_index_list, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_4cBCs_6conjuction_R(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("conjuction_R", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_9pylsewave_5cynum_4cBCs_conjuction_R(__pyx_v_self, __pyx_v_x, __pyx_v_u, __pyx_v_dt, __pyx_v_vessel_index_list, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __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("pylsewave.cynum.cBCs.conjuction_R", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_vessel_index_list, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1557
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_Jr(self, double[::1] x, int[::1] vessel_index_list, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef int d1, d2
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_9conjuction_Jr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9pylsewave_5cynum_4cBCs_conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  double __pyx_v_rho_;
  int __pyx_v_d1;
  int __pyx_v_d2;
  Py_ssize_t __pyx_v_last_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  double __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  double __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  double __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  double __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  int __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;
  __Pyx_memviewslice __pyx_t_30 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_31;
  __Pyx_memviewslice __pyx_t_32 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  __Pyx_RefNannySetupContext("conjuction_Jr", 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_conjuction_Jr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_4cBCs_9conjuction_Jr)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vessel_index_list, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_out, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1557, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_10;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":1562
 *         cdef Py_ssize_t last_i, first_i
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]             # <<<<<<<<<<<<<<
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]
 *         rho_ = self._rho
 */
  __pyx_t_11 = 0;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_11)) )));
  __pyx_t_13 = 1;
  __pyx_t_14 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_13)) )));
  __pyx_t_15 = 2;
  __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_15)) )));
  __pyx_t_17 = 3;
  __pyx_t_18 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_17)) )));
  __pyx_v_x1 = __pyx_t_12;
  __pyx_v_x2 = __pyx_t_14;
  __pyx_v_x3 = __pyx_t_16;
  __pyx_v_x4 = __pyx_t_18;

  /* "pylsewave/cynum.pyx":1563
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]             # <<<<<<<<<<<<<<
 *         rho_ = self._rho
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1
 */
  __pyx_t_19 = 0;
  __pyx_t_10 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_19)) )));
  __pyx_t_20 = 1;
  __pyx_t_21 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_20)) )));
  __pyx_v_d1 = __pyx_t_10;
  __pyx_v_d2 = __pyx_t_21;

  /* "pylsewave/cynum.pyx":1564
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]
 *         rho_ = self._rho             # <<<<<<<<<<<<<<
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1
 * 
 */
  __pyx_t_18 = __pyx_v_self->_rho;
  __pyx_v_rho_ = __pyx_t_18;

  /* "pylsewave/cynum.pyx":1565
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]
 *         rho_ = self._rho
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 * 
 *         out[0, 0] = 0.
 */
  __pyx_v_last_i = (((__pyx_v_self->vessels[__pyx_v_d1]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1567
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1
 * 
 *         out[0, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 */
  __pyx_t_22 = 0;
  __pyx_t_23 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_22 * __pyx_v_out.strides[0]) )) + __pyx_t_23)) )) = 0.;

  /* "pylsewave/cynum.pyx":1568
 * 
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.             # <<<<<<<<<<<<<<
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 */
  __pyx_t_24 = 0;
  __pyx_t_25 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_24 * __pyx_v_out.strides[0]) )) + __pyx_t_25)) )) = -1.;

  /* "pylsewave/cynum.pyx":1569
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 3] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[d1].f_r0[last_i]*(M_PI*self.vessels[d1].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 */
  __pyx_t_26 = 0;
  __pyx_t_27 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_26 * __pyx_v_out.strides[0]) )) + __pyx_t_27)) )) = 0.;

  /* "pylsewave/cynum.pyx":1570
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.             # <<<<<<<<<<<<<<
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[d1].f_r0[last_i]*(M_PI*self.vessels[d1].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2
 */
  __pyx_t_28 = 0;
  __pyx_t_29 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_28 * __pyx_v_out.strides[0]) )) + __pyx_t_29)) )) = 1.;

  /* "pylsewave/cynum.pyx":1571
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[d1].f_r0[last_i]*(M_PI*self.vessels[d1].r0[last_i]**2)**0.5 / (2*x1**(3/2.))             # <<<<<<<<<<<<<<
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x3**(3/2.))
 */
  __pyx_t_30 = (__pyx_v_self->vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_31 = __pyx_v_last_i;
  __pyx_t_32 = (__pyx_v_self->vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_33 = __pyx_v_last_i;
  __pyx_t_34 = 1;
  __pyx_t_35 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_34 * __pyx_v_out.strides[0]) )) + __pyx_t_35)) )) = ((__pyx_v_rho_ * (pow(__pyx_v_x2, 2.0) / pow(__pyx_v_x1, 3.0))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_31)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_33)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x1, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);

  /* "pylsewave/cynum.pyx":1572
 *         out[0, 3] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[d1].f_r0[last_i]*(M_PI*self.vessels[d1].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2             # <<<<<<<<<<<<<<
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2
 */
  __pyx_t_36 = 1;
  __pyx_t_37 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_36 * __pyx_v_out.strides[0]) )) + __pyx_t_37)) )) = (((-__pyx_v_rho_) * __pyx_v_x2) / pow(__pyx_v_x1, 2.0));

  /* "pylsewave/cynum.pyx":1573
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[d1].f_r0[last_i]*(M_PI*self.vessels[d1].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x3**(3/2.))             # <<<<<<<<<<<<<<
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[last_i]*sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-5/4.)
 */
  __pyx_t_32 = (__pyx_v_self->vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_38 = 0;
  __pyx_t_30 = (__pyx_v_self->vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_39 = 0;
  __pyx_t_40 = 1;
  __pyx_t_41 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_40 * __pyx_v_out.strides[0]) )) + __pyx_t_41)) )) = (((-__pyx_v_rho_) * (pow(__pyx_v_x4, 2.0) / pow(__pyx_v_x3, 3.0))) + (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_38)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_39)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x3, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);

  /* "pylsewave/cynum.pyx":1574
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2             # <<<<<<<<<<<<<<
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[last_i]*sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-5/4.)
 *         out[2, 1] = -1./x1
 */
  __pyx_t_42 = 1;
  __pyx_t_43 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_42 * __pyx_v_out.strides[0]) )) + __pyx_t_43)) )) = ((__pyx_v_rho_ * __pyx_v_x4) / pow(__pyx_v_x3, 2.0));

  /* "pylsewave/cynum.pyx":1575
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[last_i]*sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-5/4.)             # <<<<<<<<<<<<<<
 *         out[2, 1] = -1./x1
 *         out[2, 2] = 0.
 */
  __pyx_t_30 = (__pyx_v_self->vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_44 = __pyx_v_last_i;
  __pyx_t_32 = (__pyx_v_self->vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_45 = __pyx_v_last_i;
  __pyx_t_46 = 2;
  __pyx_t_47 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_46 * __pyx_v_out.strides[0]) )) + __pyx_t_47)) )) = ((__pyx_v_x2 / pow(__pyx_v_x1, 2.0)) - ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_rho_) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_44)) )))) * sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_45)) ))), 2.0))))))) * pow(__pyx_v_x1, (-5.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);

  /* "pylsewave/cynum.pyx":1576
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[last_i]*sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-5/4.)
 *         out[2, 1] = -1./x1             # <<<<<<<<<<<<<<
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 */
  __pyx_t_48 = 2;
  __pyx_t_49 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_48 * __pyx_v_out.strides[0]) )) + __pyx_t_49)) )) = (-1. / __pyx_v_x1);

  /* "pylsewave/cynum.pyx":1577
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[last_i]*sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-5/4.)
 *         out[2, 1] = -1./x1
 *         out[2, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 3] = 0.
 *         out[3, 0] = 0.
 */
  __pyx_t_50 = 2;
  __pyx_t_51 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_50 * __pyx_v_out.strides[0]) )) + __pyx_t_51)) )) = 0.;

  /* "pylsewave/cynum.pyx":1578
 *         out[2, 1] = -1./x1
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 0] = 0.
 *         out[3, 1] = 0.
 */
  __pyx_t_52 = 2;
  __pyx_t_53 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_52 * __pyx_v_out.strides[0]) )) + __pyx_t_53)) )) = 0.;

  /* "pylsewave/cynum.pyx":1579
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 *         out[3, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 1] = 0.
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-5/4.)
 */
  __pyx_t_54 = 3;
  __pyx_t_55 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_54 * __pyx_v_out.strides[0]) )) + __pyx_t_55)) )) = 0.;

  /* "pylsewave/cynum.pyx":1580
 *         out[2, 3] = 0.
 *         out[3, 0] = 0.
 *         out[3, 1] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-5/4.)
 *         out[3, 3] = -1./x3
 */
  __pyx_t_56 = 3;
  __pyx_t_57 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_56 * __pyx_v_out.strides[0]) )) + __pyx_t_57)) )) = 0.;

  /* "pylsewave/cynum.pyx":1581
 *         out[3, 0] = 0.
 *         out[3, 1] = 0.
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-5/4.)             # <<<<<<<<<<<<<<
 *         out[3, 3] = -1./x3
 * 
 */
  __pyx_t_32 = (__pyx_v_self->vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_58 = 0;
  __pyx_t_30 = (__pyx_v_self->vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_59 = 0;
  __pyx_t_60 = 3;
  __pyx_t_61 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_60 * __pyx_v_out.strides[0]) )) + __pyx_t_61)) )) = ((__pyx_v_x4 / pow(__pyx_v_x3, 2.0)) + ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_rho_) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_58)) )))) * sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_59)) ))), 2.0))))))) * pow(__pyx_v_x3, (-5.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);

  /* "pylsewave/cynum.pyx":1582
 *         out[3, 1] = 0.
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-5/4.)
 *         out[3, 3] = -1./x3             # <<<<<<<<<<<<<<
 * 
 *         return STATUS_OK
 */
  __pyx_t_62 = 3;
  __pyx_t_63 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_62 * __pyx_v_out.strides[0]) )) + __pyx_t_63)) )) = (-1. / __pyx_v_x3);

  /* "pylsewave/cynum.pyx":1584
 *         out[3, 3] = -1./x3
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 * # ------------------- \begin{BCs from Watanabe and modified by Ragkousis} ----------------------- #
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1557
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_Jr(self, double[::1] x, int[::1] vessel_index_list, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef int d1, d2
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cBCs.conjuction_Jr", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_9conjuction_Jr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_4cBCs_9conjuction_Jr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vessel_index_list = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("conjuction_Jr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_vessel_index_list,&__pyx_n_s_out,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_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index_list)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_Jr", 1, 3, 3, 1); __PYX_ERR(0, 1557, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_Jr", 1, 3, 3, 2); __PYX_ERR(0, 1557, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conjuction_Jr") < 0)) __PYX_ERR(0, 1557, __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_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1557, __pyx_L3_error)
    __pyx_v_vessel_index_list = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[1]); if (unlikely(!__pyx_v_vessel_index_list.memview)) __PYX_ERR(0, 1557, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[2]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1557, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("conjuction_Jr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1557, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cBCs.conjuction_Jr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_4cBCs_8conjuction_Jr(((struct __pyx_obj_9pylsewave_5cynum_cBCs *)__pyx_v_self), __pyx_v_x, __pyx_v_vessel_index_list, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_4cBCs_8conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("conjuction_Jr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_9pylsewave_5cynum_4cBCs_conjuction_Jr(__pyx_v_self, __pyx_v_x, __pyx_v_vessel_index_list, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1557, __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("pylsewave.cynum.cBCs.conjuction_Jr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_vessel_index_list, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1588
 * # ------------------- \begin{BCs from Watanabe and modified by Ragkousis} ----------------------- #
 * cdef class cBCsWat(cBCs):
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         _A, _q = u
 *         theta = dt / dx
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_7cBCsWat_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_7cBCsWat_U_0(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  PyObject *__pyx_v__A = NULL;
  PyObject *__pyx_v__q = NULL;
  CYTHON_UNUSED double __pyx_v_theta;
  CYTHON_UNUSED double __pyx_v_dt2;
  PyObject *__pyx_v_p_pres = NULL;
  PyObject *__pyx_v_A0 = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_A = NULL;
  PyObject *__pyx_v_W2_0 = NULL;
  PyObject *__pyx_v_W2_1 = NULL;
  PyObject *__pyx_v_l2 = NULL;
  PyObject *__pyx_v_x = NULL;
  double __pyx_v_W2;
  PyObject *__pyx_v_q = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  double __pyx_t_14;
  double __pyx_t_15;
  double __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  __Pyx_RefNannySetupContext("U_0", 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_U_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_7cBCsWat_1U_0)) {
      if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 1588, __pyx_L1_error) }
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 1588, __pyx_L1_error) }
      __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_out, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_9 = __pyx_t_1; __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_12 = PyTuple_New(6+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_11, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_11, __pyx_t_8);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":1589
 * cdef class cBCsWat(cBCs):
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u             # <<<<<<<<<<<<<<
 *         theta = dt / dx
 *         dt2 = dt / 2.
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #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_ERR(0, 1589, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_9);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_9 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_9)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1589, __pyx_L1_error)
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1589, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v__A = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v__q = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "pylsewave/cynum.pyx":1590
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u
 *         theta = dt / dx             # <<<<<<<<<<<<<<
 *         dt2 = dt / 2.
 *         p_pres = self.inlet_fun(t)
 */
  if (unlikely(__pyx_v_dx == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1590, __pyx_L1_error)
  }
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":1591
 *         _A, _q = u
 *         theta = dt / dx
 *         dt2 = dt / 2.             # <<<<<<<<<<<<<<
 *         p_pres = self.inlet_fun(t)
 * 
 */
  __pyx_v_dt2 = (__pyx_v_dt / 2.);

  /* "pylsewave/cynum.pyx":1592
 *         theta = dt / dx
 *         dt2 = dt / 2.
 *         p_pres = self.inlet_fun(t)             # <<<<<<<<<<<<<<
 * 
 *         A0 = np.pi*self.mesh.vessels[vessel_index].r0[0]**2.0
 */
  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.inlet_fun);
  __pyx_t_2 = __pyx_v_self->__pyx_base.inlet_fun; __pyx_t_12 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_12) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); __pyx_t_12 = NULL;
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_p_pres = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":1594
 *         p_pres = self.inlet_fun(t)
 * 
 *         A0 = np.pi*self.mesh.vessels[vessel_index].r0[0]**2.0             # <<<<<<<<<<<<<<
 *         f = self.mesh.vessels[vessel_index].f_r0[0]
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_vessel_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_r0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Power(__pyx_t_8, __pyx_float_2_0, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_A0 = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":1595
 * 
 *         A0 = np.pi*self.mesh.vessels[vessel_index].r0[0]**2.0
 *         f = self.mesh.vessels[vessel_index].f_r0[0]             # <<<<<<<<<<<<<<
 * 
 *         A = A0*((p_pres /f) + 1)**2.0
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_vessel_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_r0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":1597
 *         f = self.mesh.vessels[vessel_index].f_r0[0]
 * 
 *         A = A0*((p_pres /f) + 1)**2.0             # <<<<<<<<<<<<<<
 * 
 *         W2_0 = _q[0]/_A[0] - 4*self.pdes.compute_c_i(_A[0], index=0, vessel_index=vessel_index)
 */
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_p_pres, __pyx_v_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Power(__pyx_t_8, __pyx_float_2_0, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Multiply(__pyx_v_A0, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_A = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":1599
 *         A = A0*((p_pres /f) + 1)**2.0
 * 
 *         W2_0 = _q[0]/_A[0] - 4*self.pdes.compute_c_i(_A[0], index=0, vessel_index=vessel_index)             # <<<<<<<<<<<<<<
 *         W2_1 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)
 *         l2 = _q[0]/_A[0] - self.pdes.compute_c_i(_A[0], index=0, vessel_index=vessel_index)
 */
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v__q, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v__A, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v__A, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble((4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_t_14, 0, __pyx_v_vessel_index, 0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_W2_0 = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":1600
 * 
 *         W2_0 = _q[0]/_A[0] - 4*self.pdes.compute_c_i(_A[0], index=0, vessel_index=vessel_index)
 *         W2_1 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)             # <<<<<<<<<<<<<<
 *         l2 = _q[0]/_A[0] - self.pdes.compute_c_i(_A[0], index=0, vessel_index=vessel_index)
 *         x = -l2*dt
 */
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v__q, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v__A, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v__A, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble((4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_t_14, 1, __pyx_v_vessel_index, 0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_W2_1 = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":1601
 *         W2_0 = _q[0]/_A[0] - 4*self.pdes.compute_c_i(_A[0], index=0, vessel_index=vessel_index)
 *         W2_1 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)
 *         l2 = _q[0]/_A[0] - self.pdes.compute_c_i(_A[0], index=0, vessel_index=vessel_index)             # <<<<<<<<<<<<<<
 *         x = -l2*dt
 * 
 */
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v__q, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v__A, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v__A, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_t_14, 0, __pyx_v_vessel_index, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_l2 = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":1602
 *         W2_1 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)
 *         l2 = _q[0]/_A[0] - self.pdes.compute_c_i(_A[0], index=0, vessel_index=vessel_index)
 *         x = -l2*dt             # <<<<<<<<<<<<<<
 * 
 *         W2 = linear_extrapolation(x, 0.0, dx, W2_0, W2_1)
 */
  __pyx_t_8 = PyNumber_Negative(__pyx_v_l2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_x = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pylsewave/cynum.pyx":1604
 *         x = -l2*dt
 * 
 *         W2 = linear_extrapolation(x, 0.0, dx, W2_0, W2_1)             # <<<<<<<<<<<<<<
 *         q = A*(W2 + 4*self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index))
 * 
 */
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_x); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1604, __pyx_L1_error)
  __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_W2_0); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1604, __pyx_L1_error)
  __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_W2_1); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1604, __pyx_L1_error)
  __pyx_v_W2 = __pyx_f_9pylsewave_5cynum_linear_extrapolation(__pyx_t_14, 0.0, __pyx_v_dx, __pyx_t_15, __pyx_t_16, 0);

  /* "pylsewave/cynum.pyx":1605
 * 
 *         W2 = linear_extrapolation(x, 0.0, dx, W2_0, W2_1)
 *         q = A*(W2 + 4*self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index))             # <<<<<<<<<<<<<<
 * 
 *         out[0, 0] = A
 */
  __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_A); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1605, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_W2 + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_t_16, 0, __pyx_v_vessel_index, 0)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_A, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_q = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":1607
 *         q = A*(W2 + 4*self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index))
 * 
 *         out[0, 0] = A             # <<<<<<<<<<<<<<
 *         out[1, 0] = q
 * 
 */
  __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_A); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1607, __pyx_L1_error)
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  __pyx_t_19 = -1;
  if (__pyx_t_17 < 0) {
    __pyx_t_17 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_17 < 0)) __pyx_t_19 = 0;
  } else if (unlikely(__pyx_t_17 >= __pyx_v_out.shape[0])) __pyx_t_19 = 0;
  if (__pyx_t_18 < 0) {
    __pyx_t_18 += __pyx_v_out.shape[1];
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 1;
  } else if (unlikely(__pyx_t_18 >= __pyx_v_out.shape[1])) __pyx_t_19 = 1;
  if (unlikely(__pyx_t_19 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_19);
    __PYX_ERR(0, 1607, __pyx_L1_error)
  }
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_17 * __pyx_v_out.strides[0]) )) + __pyx_t_18)) )) = __pyx_t_16;

  /* "pylsewave/cynum.pyx":1608
 * 
 *         out[0, 0] = A
 *         out[1, 0] = q             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_q); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1608, __pyx_L1_error)
  __pyx_t_20 = 1;
  __pyx_t_21 = 0;
  __pyx_t_19 = -1;
  if (__pyx_t_20 < 0) {
    __pyx_t_20 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 0;
  } else if (unlikely(__pyx_t_20 >= __pyx_v_out.shape[0])) __pyx_t_19 = 0;
  if (__pyx_t_21 < 0) {
    __pyx_t_21 += __pyx_v_out.shape[1];
    if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 1;
  } else if (unlikely(__pyx_t_21 >= __pyx_v_out.shape[1])) __pyx_t_19 = 1;
  if (unlikely(__pyx_t_19 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_19);
    __PYX_ERR(0, 1608, __pyx_L1_error)
  }
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) )) + __pyx_t_21)) )) = __pyx_t_16;

  /* "pylsewave/cynum.pyx":1588
 * # ------------------- \begin{BCs from Watanabe and modified by Ragkousis} ----------------------- #
 * cdef class cBCsWat(cBCs):
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         _A, _q = u
 *         theta = dt / dx
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_WriteUnraisable("pylsewave.cynum.cBCsWat.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__A);
  __Pyx_XDECREF(__pyx_v__q);
  __Pyx_XDECREF(__pyx_v_p_pres);
  __Pyx_XDECREF(__pyx_v_A0);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_A);
  __Pyx_XDECREF(__pyx_v_W2_0);
  __Pyx_XDECREF(__pyx_v_W2_1);
  __Pyx_XDECREF(__pyx_v_l2);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_q);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_7cBCsWat_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_7cBCsWat_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_t;
  double __pyx_v_dx;
  double __pyx_v_dt;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("U_0 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_t,&__pyx_n_s_dx,&__pyx_n_s_dt,&__pyx_n_s_vessel_index,&__pyx_n_s_out,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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 1); __PYX_ERR(0, 1588, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 2); __PYX_ERR(0, 1588, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 3); __PYX_ERR(0, 1588, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 4); __PYX_ERR(0, 1588, __pyx_L3_error)
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 5); __PYX_ERR(0, 1588, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "U_0") < 0)) __PYX_ERR(0, 1588, __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_u = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_dx = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_dt = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[5]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1588, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1588, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cBCsWat.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_7cBCsWat_U_0(((struct __pyx_obj_9pylsewave_5cynum_cBCsWat *)__pyx_v_self), __pyx_v_u, __pyx_v_t, __pyx_v_dx, __pyx_v_dt, __pyx_v_vessel_index, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_7cBCsWat_U_0(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("U_0", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 1588, __pyx_L1_error) }
  if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 1588, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_7cBCsWat_U_0(__pyx_v_self, __pyx_v_u, __pyx_v_t, __pyx_v_dx, __pyx_v_dt, __pyx_v_vessel_index, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1588, __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("pylsewave.cynum.cBCsWat.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1614
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_R(self, double[::1] x, double[::1] u, double dt, int[::1] vessel_index_list, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, x5, x6
 *         cdef int p, d1, d2
 */

static int __pyx_f_9pylsewave_5cynum_7cBCsWat_bifurcation_R(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  double __pyx_v_x5;
  double __pyx_v_x6;
  int __pyx_v_p;
  int __pyx_v_d1;
  int __pyx_v_d2;
  double __pyx_v_A_p;
  double __pyx_v_q_p;
  double __pyx_v_A_d1;
  double __pyx_v_q_d1;
  double __pyx_v_A_d2;
  double __pyx_v_q_d2;
  Py_ssize_t __pyx_v_last_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_first_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  double __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  double __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  double __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  double __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  double __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  double __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __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;
  __Pyx_memviewslice __pyx_t_26 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_27;
  __Pyx_memviewslice __pyx_t_28 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_29;
  __Pyx_memviewslice __pyx_t_30 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_31;
  __Pyx_memviewslice __pyx_t_32 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  __Pyx_RefNannySetupContext("bifurcation_R", 0);

  /* "pylsewave/cynum.pyx":1622
 *         cdef double w1, w2, x_i, W
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]             # <<<<<<<<<<<<<<
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]
 */
  __pyx_t_1 = 0;
  __pyx_t_2 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_1)) )));
  __pyx_t_3 = 1;
  __pyx_t_4 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_3)) )));
  __pyx_t_5 = 2;
  __pyx_t_6 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_5)) )));
  __pyx_t_7 = 3;
  __pyx_t_8 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_7)) )));
  __pyx_t_9 = 4;
  __pyx_t_10 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_9)) )));
  __pyx_t_11 = 5;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_11)) )));
  __pyx_v_x1 = __pyx_t_2;
  __pyx_v_x2 = __pyx_t_4;
  __pyx_v_x3 = __pyx_t_6;
  __pyx_v_x4 = __pyx_t_8;
  __pyx_v_x5 = __pyx_t_10;
  __pyx_v_x6 = __pyx_t_12;

  /* "pylsewave/cynum.pyx":1623
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]             # <<<<<<<<<<<<<<
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]
 * 
 */
  __pyx_t_13 = 0;
  __pyx_t_14 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_13)) )));
  __pyx_t_15 = 1;
  __pyx_t_16 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_15)) )));
  __pyx_t_17 = 2;
  __pyx_t_18 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_17)) )));
  __pyx_v_p = __pyx_t_14;
  __pyx_v_d1 = __pyx_t_16;
  __pyx_v_d2 = __pyx_t_18;

  /* "pylsewave/cynum.pyx":1624
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]             # <<<<<<<<<<<<<<
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 */
  __pyx_t_19 = 0;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_19)) )));
  __pyx_t_20 = 1;
  __pyx_t_10 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_20)) )));
  __pyx_t_21 = 2;
  __pyx_t_8 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_21)) )));
  __pyx_t_22 = 3;
  __pyx_t_6 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_22)) )));
  __pyx_t_23 = 4;
  __pyx_t_4 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_23)) )));
  __pyx_t_24 = 5;
  __pyx_t_2 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_24)) )));
  __pyx_v_A_p = __pyx_t_12;
  __pyx_v_q_p = __pyx_t_10;
  __pyx_v_A_d1 = __pyx_t_8;
  __pyx_v_q_d1 = __pyx_t_6;
  __pyx_v_A_d2 = __pyx_t_4;
  __pyx_v_q_d2 = __pyx_t_2;

  /* "pylsewave/cynum.pyx":1626
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 *         first_i = 0
 * 
 */
  __pyx_v_last_i = (((__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1627
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 *         first_i = 0             # <<<<<<<<<<<<<<
 * 
 *         out[0] = -x2 + x4 + x6
 */
  __pyx_v_first_i = 0;

  /* "pylsewave/cynum.pyx":1629
 *         first_i = 0
 * 
 *         out[0] = -x2 + x4 + x6             # <<<<<<<<<<<<<<
 *         out[1] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +
 */
  __pyx_t_25 = 0;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_25)) )) = (((-__pyx_v_x2) + __pyx_v_x4) + __pyx_v_x6);

  /* "pylsewave/cynum.pyx":1630
 * 
 *         out[0] = -x2 + x4 + x6
 *         out[1] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(             # <<<<<<<<<<<<<<
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[0]*(sqrt(x3 / (M_PI*self.vessels[d1].r0[0]**2)) - 1))
 */
  __pyx_t_26 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_26, 1);
  __pyx_t_27 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1631
 *         out[0] = -x2 + x4 + x6
 *         out[1] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +             # <<<<<<<<<<<<<<
 *                   self.vessels[d1].f_r0[0]*(sqrt(x3 / (M_PI*self.vessels[d1].r0[0]**2)) - 1))
 *         out[2] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(
 */
  __pyx_t_28 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
  __pyx_t_29 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1632
 *         out[1] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[0]*(sqrt(x3 / (M_PI*self.vessels[d1].r0[0]**2)) - 1))             # <<<<<<<<<<<<<<
 *         out[2] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x6/x5)**2 +
 */
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_31 = 0;
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_33 = 0;

  /* "pylsewave/cynum.pyx":1630
 * 
 *         out[0] = -x2 + x4 + x6
 *         out[1] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(             # <<<<<<<<<<<<<<
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[0]*(sqrt(x3 / (M_PI*self.vessels[d1].r0[0]**2)) - 1))
 */
  __pyx_t_34 = 1;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_34)) )) = (((((-0.5 * __pyx_v_self->__pyx_base._rho) * pow((__pyx_v_x2 / __pyx_v_x1), 2.0)) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_26.data) + __pyx_t_27)) ))) * (sqrt((__pyx_v_x1 / (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_28.data) + __pyx_t_29)) ))), 2.0)))) - 1.0))) + ((0.5 * __pyx_v_self->__pyx_base._rho) * pow((__pyx_v_x4 / __pyx_v_x3), 2.0))) + ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_31)) ))) * (sqrt((__pyx_v_x3 / (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_33)) ))), 2.0)))) - 1.0)));
  __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);

  /* "pylsewave/cynum.pyx":1633
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[0]*(sqrt(x3 / (M_PI*self.vessels[d1].r0[0]**2)) - 1))
 *         out[2] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(             # <<<<<<<<<<<<<<
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(sqrt(x5 / (M_PI*self.vessels[d2].r0[0]**2)) - 1))
 */
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_35 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1634
 *                   self.vessels[d1].f_r0[0]*(sqrt(x3 / (M_PI*self.vessels[d1].r0[0]**2)) - 1))
 *         out[2] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x6/x5)**2 +             # <<<<<<<<<<<<<<
 *                   self.vessels[d2].f_r0[0]*(sqrt(x5 / (M_PI*self.vessels[d2].r0[0]**2)) - 1))
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +
 */
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_36 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1635
 *         out[2] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(sqrt(x5 / (M_PI*self.vessels[d2].r0[0]**2)) - 1))             # <<<<<<<<<<<<<<
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +
 *                   (q_p/A_p + 4*self.pdes.compute_c_i(A_p, index=last_i-1, vessel_index=p)))
 */
  __pyx_t_28 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
  __pyx_t_37 = 0;
  __pyx_t_26 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_26, 1);
  __pyx_t_38 = 0;

  /* "pylsewave/cynum.pyx":1633
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[0]*(sqrt(x3 / (M_PI*self.vessels[d1].r0[0]**2)) - 1))
 *         out[2] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(             # <<<<<<<<<<<<<<
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(sqrt(x5 / (M_PI*self.vessels[d2].r0[0]**2)) - 1))
 */
  __pyx_t_39 = 2;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_39)) )) = (((((-0.5 * __pyx_v_self->__pyx_base._rho) * pow((__pyx_v_x2 / __pyx_v_x1), 2.0)) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_35)) ))) * (sqrt((__pyx_v_x1 / (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_36)) ))), 2.0)))) - 1.0))) + ((0.5 * __pyx_v_self->__pyx_base._rho) * pow((__pyx_v_x6 / __pyx_v_x5), 2.0))) + ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_28.data) + __pyx_t_37)) ))) * (sqrt((__pyx_v_x5 / (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_26.data) + __pyx_t_38)) ))), 2.0)))) - 1.0)));
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);

  /* "pylsewave/cynum.pyx":1636
 *                   sqrt(x1 / (M_PI*self.vessels[p].r0[last_i]**2)) - 1) + 0.5*self._rho*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(sqrt(x5 / (M_PI*self.vessels[d2].r0[0]**2)) - 1))
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +             # <<<<<<<<<<<<<<
 *                   (q_p/A_p + 4*self.pdes.compute_c_i(A_p, index=last_i-1, vessel_index=p)))
 *         out[4] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d1) +
 */
  __pyx_t_40 = 3;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_40)) )) = ((((-__pyx_v_x2) / __pyx_v_x1) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_x1, __pyx_v_last_i, __pyx_v_p, 0))) + ((__pyx_v_q_p / __pyx_v_A_p) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_A_p, (__pyx_v_last_i - 1), __pyx_v_p, 0))));

  /* "pylsewave/cynum.pyx":1638
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +
 *                   (q_p/A_p + 4*self.pdes.compute_c_i(A_p, index=last_i-1, vessel_index=p)))
 *         out[4] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d1) +             # <<<<<<<<<<<<<<
 *                   (q_d1/A_d1 - 4*self.pdes.compute_c_i(A_d1, index=1, vessel_index=d1)))
 *         out[5] = (-x6/x5 + 4*self.pdes.compute_c_i(x5, index=0, vessel_index=d2) +
 */
  __pyx_t_41 = 4;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_41)) )) = ((((-__pyx_v_x4) / __pyx_v_x3) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_x3, 0, __pyx_v_d1, 0))) + ((__pyx_v_q_d1 / __pyx_v_A_d1) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_A_d1, 1, __pyx_v_d1, 0))));

  /* "pylsewave/cynum.pyx":1640
 *         out[4] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d1) +
 *                   (q_d1/A_d1 - 4*self.pdes.compute_c_i(A_d1, index=1, vessel_index=d1)))
 *         out[5] = (-x6/x5 + 4*self.pdes.compute_c_i(x5, index=0, vessel_index=d2) +             # <<<<<<<<<<<<<<
 *                   (q_d2/A_d2 - 4*self.pdes.compute_c_i(A_d2, index=1, vessel_index=d2)))
 * 
 */
  __pyx_t_42 = 5;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_42)) )) = ((((-__pyx_v_x6) / __pyx_v_x5) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_x5, 0, __pyx_v_d2, 0))) + ((__pyx_v_q_d2 / __pyx_v_A_d2) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_A_d2, 1, __pyx_v_d2, 0))));

  /* "pylsewave/cynum.pyx":1643
 *                   (q_d2/A_d2 - 4*self.pdes.compute_c_i(A_d2, index=1, vessel_index=d2)))
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1614
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_R(self, double[::1] x, double[::1] u, double dt, int[::1] vessel_index_list, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, x5, x6
 *         cdef int p, d1, d2
 */

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

/* "pylsewave/cynum.pyx":1649
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_Jr(self, double[::1] x, int[::1] vessel_index_list, double[:, ::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, x5, x6, rho_
 *         cdef int p, d1, d2
 */

static int __pyx_f_9pylsewave_5cynum_7cBCsWat_bifurcation_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  double __pyx_v_x5;
  double __pyx_v_x6;
  int __pyx_v_p;
  int __pyx_v_d1;
  int __pyx_v_d2;
  Py_ssize_t __pyx_v_last_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_first_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  double __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  double __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  double __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  double __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  double __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  double __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __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;
  Py_ssize_t __pyx_t_30;
  __Pyx_memviewslice __pyx_t_31 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_32;
  __Pyx_memviewslice __pyx_t_33 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  Py_ssize_t __pyx_t_64;
  Py_ssize_t __pyx_t_65;
  Py_ssize_t __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  Py_ssize_t __pyx_t_70;
  Py_ssize_t __pyx_t_71;
  Py_ssize_t __pyx_t_72;
  Py_ssize_t __pyx_t_73;
  Py_ssize_t __pyx_t_74;
  Py_ssize_t __pyx_t_75;
  Py_ssize_t __pyx_t_76;
  Py_ssize_t __pyx_t_77;
  Py_ssize_t __pyx_t_78;
  Py_ssize_t __pyx_t_79;
  Py_ssize_t __pyx_t_80;
  Py_ssize_t __pyx_t_81;
  Py_ssize_t __pyx_t_82;
  Py_ssize_t __pyx_t_83;
  Py_ssize_t __pyx_t_84;
  Py_ssize_t __pyx_t_85;
  Py_ssize_t __pyx_t_86;
  Py_ssize_t __pyx_t_87;
  Py_ssize_t __pyx_t_88;
  Py_ssize_t __pyx_t_89;
  Py_ssize_t __pyx_t_90;
  Py_ssize_t __pyx_t_91;
  Py_ssize_t __pyx_t_92;
  Py_ssize_t __pyx_t_93;
  Py_ssize_t __pyx_t_94;
  Py_ssize_t __pyx_t_95;
  Py_ssize_t __pyx_t_96;
  Py_ssize_t __pyx_t_97;
  Py_ssize_t __pyx_t_98;
  Py_ssize_t __pyx_t_99;
  Py_ssize_t __pyx_t_100;
  Py_ssize_t __pyx_t_101;
  Py_ssize_t __pyx_t_102;
  Py_ssize_t __pyx_t_103;
  Py_ssize_t __pyx_t_104;
  Py_ssize_t __pyx_t_105;
  Py_ssize_t __pyx_t_106;
  __Pyx_RefNannySetupContext("bifurcation_Jr", 0);

  /* "pylsewave/cynum.pyx":1654
 *         cdef Py_ssize_t last_i, first_i
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]             # <<<<<<<<<<<<<<
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 * 
 */
  __pyx_t_1 = 0;
  __pyx_t_2 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_1)) )));
  __pyx_t_3 = 1;
  __pyx_t_4 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_3)) )));
  __pyx_t_5 = 2;
  __pyx_t_6 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_5)) )));
  __pyx_t_7 = 3;
  __pyx_t_8 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_7)) )));
  __pyx_t_9 = 4;
  __pyx_t_10 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_9)) )));
  __pyx_t_11 = 5;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_11)) )));
  __pyx_v_x1 = __pyx_t_2;
  __pyx_v_x2 = __pyx_t_4;
  __pyx_v_x3 = __pyx_t_6;
  __pyx_v_x4 = __pyx_t_8;
  __pyx_v_x5 = __pyx_t_10;
  __pyx_v_x6 = __pyx_t_12;

  /* "pylsewave/cynum.pyx":1655
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]             # <<<<<<<<<<<<<<
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 */
  __pyx_t_13 = 0;
  __pyx_t_14 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_13)) )));
  __pyx_t_15 = 1;
  __pyx_t_16 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_15)) )));
  __pyx_t_17 = 2;
  __pyx_t_18 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_17)) )));
  __pyx_v_p = __pyx_t_14;
  __pyx_v_d1 = __pyx_t_16;
  __pyx_v_d2 = __pyx_t_18;

  /* "pylsewave/cynum.pyx":1657
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 *         first_i = 0
 * 
 */
  __pyx_v_last_i = (((__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1658
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 *         first_i = 0             # <<<<<<<<<<<<<<
 * 
 *         out[0, 0] = 0.
 */
  __pyx_v_first_i = 0;

  /* "pylsewave/cynum.pyx":1660
 *         first_i = 0
 * 
 *         out[0, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 */
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) )) + __pyx_t_20)) )) = 0.;

  /* "pylsewave/cynum.pyx":1661
 * 
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.             # <<<<<<<<<<<<<<
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 */
  __pyx_t_21 = 0;
  __pyx_t_22 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_21 * __pyx_v_out.strides[0]) )) + __pyx_t_22)) )) = -1.;

  /* "pylsewave/cynum.pyx":1662
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 3] = 1.
 *         out[0, 4] = 0.
 */
  __pyx_t_23 = 0;
  __pyx_t_24 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_23 * __pyx_v_out.strides[0]) )) + __pyx_t_24)) )) = 0.;

  /* "pylsewave/cynum.pyx":1663
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.             # <<<<<<<<<<<<<<
 *         out[0, 4] = 0.
 *         out[0, 5] = 1.
 */
  __pyx_t_25 = 0;
  __pyx_t_26 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_25 * __pyx_v_out.strides[0]) )) + __pyx_t_26)) )) = 1.;

  /* "pylsewave/cynum.pyx":1664
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 *         out[0, 4] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 5] = 1.
 *         out[1, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[p].f_r0[last_i]*((M_PI*self.vessels[p].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 */
  __pyx_t_27 = 0;
  __pyx_t_28 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_27 * __pyx_v_out.strides[0]) )) + __pyx_t_28)) )) = 0.;

  /* "pylsewave/cynum.pyx":1665
 *         out[0, 3] = 1.
 *         out[0, 4] = 0.
 *         out[0, 5] = 1.             # <<<<<<<<<<<<<<
 *         out[1, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[p].f_r0[last_i]*((M_PI*self.vessels[p].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 *         out[1, 1] =  -self._rho*x2 / x1**2
 */
  __pyx_t_29 = 0;
  __pyx_t_30 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_29 * __pyx_v_out.strides[0]) )) + __pyx_t_30)) )) = 1.;

  /* "pylsewave/cynum.pyx":1666
 *         out[0, 4] = 0.
 *         out[0, 5] = 1.
 *         out[1, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[p].f_r0[last_i]*((M_PI*self.vessels[p].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))             # <<<<<<<<<<<<<<
 *         out[1, 1] =  -self._rho*x2 / x1**2
 *         out[1, 2] = -self._rho*(x4**2 / x3**3) + 0.5*self.vessels[d1].f_r0[0]*((M_PI*self.vessels[d1].r0[0]**2)**(-0.5))*(x3**(-1/2.))
 */
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_32 = __pyx_v_last_i;
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_34 = __pyx_v_last_i;
  __pyx_t_35 = 1;
  __pyx_t_36 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_35 * __pyx_v_out.strides[0]) )) + __pyx_t_36)) )) = ((__pyx_v_self->__pyx_base._rho * (pow(__pyx_v_x2, 2.0) / pow(__pyx_v_x1, 3.0))) - (((0.5 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_32)) )))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_34)) ))), 2.0)), -0.5)) * pow(__pyx_v_x1, (-1.0 / 2.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1667
 *         out[0, 5] = 1.
 *         out[1, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[p].f_r0[last_i]*((M_PI*self.vessels[p].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 *         out[1, 1] =  -self._rho*x2 / x1**2             # <<<<<<<<<<<<<<
 *         out[1, 2] = -self._rho*(x4**2 / x3**3) + 0.5*self.vessels[d1].f_r0[0]*((M_PI*self.vessels[d1].r0[0]**2)**(-0.5))*(x3**(-1/2.))
 *         out[1, 3] = self._rho*x4 / x3**2
 */
  __pyx_t_37 = 1;
  __pyx_t_38 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_37 * __pyx_v_out.strides[0]) )) + __pyx_t_38)) )) = (((-__pyx_v_self->__pyx_base._rho) * __pyx_v_x2) / pow(__pyx_v_x1, 2.0));

  /* "pylsewave/cynum.pyx":1668
 *         out[1, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[p].f_r0[last_i]*((M_PI*self.vessels[p].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 *         out[1, 1] =  -self._rho*x2 / x1**2
 *         out[1, 2] = -self._rho*(x4**2 / x3**3) + 0.5*self.vessels[d1].f_r0[0]*((M_PI*self.vessels[d1].r0[0]**2)**(-0.5))*(x3**(-1/2.))             # <<<<<<<<<<<<<<
 *         out[1, 3] = self._rho*x4 / x3**2
 *         out[1, 4] = 0.
 */
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_39 = 0;
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_40 = 0;
  __pyx_t_41 = 1;
  __pyx_t_42 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_41 * __pyx_v_out.strides[0]) )) + __pyx_t_42)) )) = (((-__pyx_v_self->__pyx_base._rho) * (pow(__pyx_v_x4, 2.0) / pow(__pyx_v_x3, 3.0))) + (((0.5 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_39)) )))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_40)) ))), 2.0)), -0.5)) * pow(__pyx_v_x3, (-1.0 / 2.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);

  /* "pylsewave/cynum.pyx":1669
 *         out[1, 1] =  -self._rho*x2 / x1**2
 *         out[1, 2] = -self._rho*(x4**2 / x3**3) + 0.5*self.vessels[d1].f_r0[0]*((M_PI*self.vessels[d1].r0[0]**2)**(-0.5))*(x3**(-1/2.))
 *         out[1, 3] = self._rho*x4 / x3**2             # <<<<<<<<<<<<<<
 *         out[1, 4] = 0.
 *         out[1, 5] = 0.
 */
  __pyx_t_43 = 1;
  __pyx_t_44 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_43 * __pyx_v_out.strides[0]) )) + __pyx_t_44)) )) = ((__pyx_v_self->__pyx_base._rho * __pyx_v_x4) / pow(__pyx_v_x3, 2.0));

  /* "pylsewave/cynum.pyx":1670
 *         out[1, 2] = -self._rho*(x4**2 / x3**3) + 0.5*self.vessels[d1].f_r0[0]*((M_PI*self.vessels[d1].r0[0]**2)**(-0.5))*(x3**(-1/2.))
 *         out[1, 3] = self._rho*x4 / x3**2
 *         out[1, 4] = 0.             # <<<<<<<<<<<<<<
 *         out[1, 5] = 0.
 *         out[2, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[p].f_r0[last_i]*((M_PI*self.vessels[p].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 */
  __pyx_t_45 = 1;
  __pyx_t_46 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_45 * __pyx_v_out.strides[0]) )) + __pyx_t_46)) )) = 0.;

  /* "pylsewave/cynum.pyx":1671
 *         out[1, 3] = self._rho*x4 / x3**2
 *         out[1, 4] = 0.
 *         out[1, 5] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[p].f_r0[last_i]*((M_PI*self.vessels[p].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 *         out[2, 1] = -self._rho*x2 / x1**2
 */
  __pyx_t_47 = 1;
  __pyx_t_48 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_47 * __pyx_v_out.strides[0]) )) + __pyx_t_48)) )) = 0.;

  /* "pylsewave/cynum.pyx":1672
 *         out[1, 4] = 0.
 *         out[1, 5] = 0.
 *         out[2, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[p].f_r0[last_i]*((M_PI*self.vessels[p].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))             # <<<<<<<<<<<<<<
 *         out[2, 1] = -self._rho*x2 / x1**2
 *         out[2, 2] = 0.
 */
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_49 = __pyx_v_last_i;
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_50 = __pyx_v_last_i;
  __pyx_t_51 = 2;
  __pyx_t_52 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_51 * __pyx_v_out.strides[0]) )) + __pyx_t_52)) )) = ((__pyx_v_self->__pyx_base._rho * (pow(__pyx_v_x2, 2.0) / pow(__pyx_v_x1, 3.0))) - (((0.5 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_49)) )))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_50)) ))), 2.0)), -0.5)) * pow(__pyx_v_x1, (-1.0 / 2.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1673
 *         out[1, 5] = 0.
 *         out[2, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[p].f_r0[last_i]*((M_PI*self.vessels[p].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 *         out[2, 1] = -self._rho*x2 / x1**2             # <<<<<<<<<<<<<<
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 */
  __pyx_t_53 = 2;
  __pyx_t_54 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_53 * __pyx_v_out.strides[0]) )) + __pyx_t_54)) )) = (((-__pyx_v_self->__pyx_base._rho) * __pyx_v_x2) / pow(__pyx_v_x1, 2.0));

  /* "pylsewave/cynum.pyx":1674
 *         out[2, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[p].f_r0[last_i]*((M_PI*self.vessels[p].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 *         out[2, 1] = -self._rho*x2 / x1**2
 *         out[2, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 3] = 0.
 *         out[2, 4] = -self._rho*(x6**2 / x5**3) + 0.5*self.vessels[d2].f_r0[0]*((M_PI*self.vessels[d2].r0[0]**2)**(-0.5))*(x5**(-1/2.))
 */
  __pyx_t_55 = 2;
  __pyx_t_56 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_55 * __pyx_v_out.strides[0]) )) + __pyx_t_56)) )) = 0.;

  /* "pylsewave/cynum.pyx":1675
 *         out[2, 1] = -self._rho*x2 / x1**2
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 4] = -self._rho*(x6**2 / x5**3) + 0.5*self.vessels[d2].f_r0[0]*((M_PI*self.vessels[d2].r0[0]**2)**(-0.5))*(x5**(-1/2.))
 *         out[2, 5] = self._rho*x6 / x5**2
 */
  __pyx_t_57 = 2;
  __pyx_t_58 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_57 * __pyx_v_out.strides[0]) )) + __pyx_t_58)) )) = 0.;

  /* "pylsewave/cynum.pyx":1676
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 *         out[2, 4] = -self._rho*(x6**2 / x5**3) + 0.5*self.vessels[d2].f_r0[0]*((M_PI*self.vessels[d2].r0[0]**2)**(-0.5))*(x5**(-1/2.))             # <<<<<<<<<<<<<<
 *         out[2, 5] = self._rho*x6 / x5**2
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[p].f_r0[last_i] / sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-3/4.)
 */
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_59 = 0;
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_60 = 0;
  __pyx_t_61 = 2;
  __pyx_t_62 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_61 * __pyx_v_out.strides[0]) )) + __pyx_t_62)) )) = (((-__pyx_v_self->__pyx_base._rho) * (pow(__pyx_v_x6, 2.0) / pow(__pyx_v_x5, 3.0))) + (((0.5 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_59)) )))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_60)) ))), 2.0)), -0.5)) * pow(__pyx_v_x5, (-1.0 / 2.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);

  /* "pylsewave/cynum.pyx":1677
 *         out[2, 3] = 0.
 *         out[2, 4] = -self._rho*(x6**2 / x5**3) + 0.5*self.vessels[d2].f_r0[0]*((M_PI*self.vessels[d2].r0[0]**2)**(-0.5))*(x5**(-1/2.))
 *         out[2, 5] = self._rho*x6 / x5**2             # <<<<<<<<<<<<<<
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[p].f_r0[last_i] / sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-3/4.)
 *         out[3, 1] = -1./x1
 */
  __pyx_t_63 = 2;
  __pyx_t_64 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_63 * __pyx_v_out.strides[0]) )) + __pyx_t_64)) )) = ((__pyx_v_self->__pyx_base._rho * __pyx_v_x6) / pow(__pyx_v_x5, 2.0));

  /* "pylsewave/cynum.pyx":1678
 *         out[2, 4] = -self._rho*(x6**2 / x5**3) + 0.5*self.vessels[d2].f_r0[0]*((M_PI*self.vessels[d2].r0[0]**2)**(-0.5))*(x5**(-1/2.))
 *         out[2, 5] = self._rho*x6 / x5**2
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[p].f_r0[last_i] / sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-3/4.)             # <<<<<<<<<<<<<<
 *         out[3, 1] = -1./x1
 *         out[3, 2] = 0.0
 */
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_65 = __pyx_v_last_i;
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_66 = __pyx_v_last_i;
  __pyx_t_67 = 3;
  __pyx_t_68 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_67 * __pyx_v_out.strides[0]) )) + __pyx_t_68)) )) = ((__pyx_v_x2 / pow(__pyx_v_x1, 2.0)) - ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_self->__pyx_base._rho) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_65)) )))) / sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_66)) ))), 2.0))))))) * pow(__pyx_v_x1, (-3.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1679
 *         out[2, 5] = self._rho*x6 / x5**2
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[p].f_r0[last_i] / sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-3/4.)
 *         out[3, 1] = -1./x1             # <<<<<<<<<<<<<<
 *         out[3, 2] = 0.0
 *         out[3, 3] = 0.0
 */
  __pyx_t_69 = 3;
  __pyx_t_70 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_69 * __pyx_v_out.strides[0]) )) + __pyx_t_70)) )) = (-1. / __pyx_v_x1);

  /* "pylsewave/cynum.pyx":1680
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[p].f_r0[last_i] / sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-3/4.)
 *         out[3, 1] = -1./x1
 *         out[3, 2] = 0.0             # <<<<<<<<<<<<<<
 *         out[3, 3] = 0.0
 *         out[3, 4] = 0.0
 */
  __pyx_t_71 = 3;
  __pyx_t_72 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_71 * __pyx_v_out.strides[0]) )) + __pyx_t_72)) )) = 0.0;

  /* "pylsewave/cynum.pyx":1681
 *         out[3, 1] = -1./x1
 *         out[3, 2] = 0.0
 *         out[3, 3] = 0.0             # <<<<<<<<<<<<<<
 *         out[3, 4] = 0.0
 *         out[3, 5] = 0.0
 */
  __pyx_t_73 = 3;
  __pyx_t_74 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_73 * __pyx_v_out.strides[0]) )) + __pyx_t_74)) )) = 0.0;

  /* "pylsewave/cynum.pyx":1682
 *         out[3, 2] = 0.0
 *         out[3, 3] = 0.0
 *         out[3, 4] = 0.0             # <<<<<<<<<<<<<<
 *         out[3, 5] = 0.0
 *         out[4, 0] = 0.0
 */
  __pyx_t_75 = 3;
  __pyx_t_76 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_75 * __pyx_v_out.strides[0]) )) + __pyx_t_76)) )) = 0.0;

  /* "pylsewave/cynum.pyx":1683
 *         out[3, 3] = 0.0
 *         out[3, 4] = 0.0
 *         out[3, 5] = 0.0             # <<<<<<<<<<<<<<
 *         out[4, 0] = 0.0
 *         out[4, 1] = 0.0
 */
  __pyx_t_77 = 3;
  __pyx_t_78 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_77 * __pyx_v_out.strides[0]) )) + __pyx_t_78)) )) = 0.0;

  /* "pylsewave/cynum.pyx":1684
 *         out[3, 4] = 0.0
 *         out[3, 5] = 0.0
 *         out[4, 0] = 0.0             # <<<<<<<<<<<<<<
 *         out[4, 1] = 0.0
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d1].f_r0[0] / sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-3/4.)
 */
  __pyx_t_79 = 4;
  __pyx_t_80 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_79 * __pyx_v_out.strides[0]) )) + __pyx_t_80)) )) = 0.0;

  /* "pylsewave/cynum.pyx":1685
 *         out[3, 5] = 0.0
 *         out[4, 0] = 0.0
 *         out[4, 1] = 0.0             # <<<<<<<<<<<<<<
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d1].f_r0[0] / sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-3/4.)
 *         out[4, 3] = -1./x3
 */
  __pyx_t_81 = 4;
  __pyx_t_82 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_81 * __pyx_v_out.strides[0]) )) + __pyx_t_82)) )) = 0.0;

  /* "pylsewave/cynum.pyx":1686
 *         out[4, 0] = 0.0
 *         out[4, 1] = 0.0
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d1].f_r0[0] / sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-3/4.)             # <<<<<<<<<<<<<<
 *         out[4, 3] = -1./x3
 *         out[4, 4] = 0.
 */
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_83 = 0;
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_84 = 0;
  __pyx_t_85 = 4;
  __pyx_t_86 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_85 * __pyx_v_out.strides[0]) )) + __pyx_t_86)) )) = ((__pyx_v_x4 / pow(__pyx_v_x3, 2.0)) + ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_self->__pyx_base._rho) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_83)) )))) / sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_84)) ))), 2.0))))))) * pow(__pyx_v_x3, (-3.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);

  /* "pylsewave/cynum.pyx":1687
 *         out[4, 1] = 0.0
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d1].f_r0[0] / sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-3/4.)
 *         out[4, 3] = -1./x3             # <<<<<<<<<<<<<<
 *         out[4, 4] = 0.
 *         out[4, 5] = 0.
 */
  __pyx_t_87 = 4;
  __pyx_t_88 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_87 * __pyx_v_out.strides[0]) )) + __pyx_t_88)) )) = (-1. / __pyx_v_x3);

  /* "pylsewave/cynum.pyx":1688
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d1].f_r0[0] / sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-3/4.)
 *         out[4, 3] = -1./x3
 *         out[4, 4] = 0.             # <<<<<<<<<<<<<<
 *         out[4, 5] = 0.
 *         out[5, 0] = 0.
 */
  __pyx_t_89 = 4;
  __pyx_t_90 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_89 * __pyx_v_out.strides[0]) )) + __pyx_t_90)) )) = 0.;

  /* "pylsewave/cynum.pyx":1689
 *         out[4, 3] = -1./x3
 *         out[4, 4] = 0.
 *         out[4, 5] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 0] = 0.
 *         out[5, 1] = 0.
 */
  __pyx_t_91 = 4;
  __pyx_t_92 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_91 * __pyx_v_out.strides[0]) )) + __pyx_t_92)) )) = 0.;

  /* "pylsewave/cynum.pyx":1690
 *         out[4, 4] = 0.
 *         out[4, 5] = 0.
 *         out[5, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 1] = 0.
 *         out[5, 2] = 0.
 */
  __pyx_t_93 = 5;
  __pyx_t_94 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_93 * __pyx_v_out.strides[0]) )) + __pyx_t_94)) )) = 0.;

  /* "pylsewave/cynum.pyx":1691
 *         out[4, 5] = 0.
 *         out[5, 0] = 0.
 *         out[5, 1] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 2] = 0.
 *         out[5, 3] = 0.
 */
  __pyx_t_95 = 5;
  __pyx_t_96 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_95 * __pyx_v_out.strides[0]) )) + __pyx_t_96)) )) = 0.;

  /* "pylsewave/cynum.pyx":1692
 *         out[5, 0] = 0.
 *         out[5, 1] = 0.
 *         out[5, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 3] = 0.
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d2].f_r0[0] / sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-3/4.)
 */
  __pyx_t_97 = 5;
  __pyx_t_98 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_97 * __pyx_v_out.strides[0]) )) + __pyx_t_98)) )) = 0.;

  /* "pylsewave/cynum.pyx":1693
 *         out[5, 1] = 0.
 *         out[5, 2] = 0.
 *         out[5, 3] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d2].f_r0[0] / sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-3/4.)
 *         out[5, 5] = -1./x5
 */
  __pyx_t_99 = 5;
  __pyx_t_100 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_99 * __pyx_v_out.strides[0]) )) + __pyx_t_100)) )) = 0.;

  /* "pylsewave/cynum.pyx":1694
 *         out[5, 2] = 0.
 *         out[5, 3] = 0.
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d2].f_r0[0] / sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-3/4.)             # <<<<<<<<<<<<<<
 *         out[5, 5] = -1./x5
 * 
 */
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_101 = 0;
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_102 = 0;
  __pyx_t_103 = 5;
  __pyx_t_104 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_103 * __pyx_v_out.strides[0]) )) + __pyx_t_104)) )) = ((__pyx_v_x6 / pow(__pyx_v_x5, 2.0)) + ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_self->__pyx_base._rho) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_101)) )))) / sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_102)) ))), 2.0))))))) * pow(__pyx_v_x5, (-3.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1695
 *         out[5, 3] = 0.
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d2].f_r0[0] / sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-3/4.)
 *         out[5, 5] = -1./x5             # <<<<<<<<<<<<<<
 * 
 *         return STATUS_OK
 */
  __pyx_t_105 = 5;
  __pyx_t_106 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_105 * __pyx_v_out.strides[0]) )) + __pyx_t_106)) )) = (-1. / __pyx_v_x5);

  /* "pylsewave/cynum.pyx":1697
 *         out[5, 5] = -1./x5
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1649
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_Jr(self, double[::1] x, int[::1] vessel_index_list, double[:, ::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, x5, x6, rho_
 *         cdef int p, d1, d2
 */

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

/* "pylsewave/cynum.pyx":1703
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_R(self, double[::1] x, double[::1] u, double dt, int[::1] vessel_index_list, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef double A_d1, q_d1, A_d2, q_d2
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_7cBCsWat_3conjuction_R(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9pylsewave_5cynum_7cBCsWat_conjuction_R(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  double __pyx_v_A_d1;
  double __pyx_v_q_d1;
  double __pyx_v_A_d2;
  double __pyx_v_q_d2;
  int __pyx_v_d1;
  int __pyx_v_d2;
  Py_ssize_t __pyx_v_last_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_first_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  double __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  double __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  double __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  double __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  int __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;
  __Pyx_memviewslice __pyx_t_29 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_30;
  __Pyx_memviewslice __pyx_t_31 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_32;
  __Pyx_memviewslice __pyx_t_33 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_34;
  __Pyx_memviewslice __pyx_t_35 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  __Pyx_RefNannySetupContext("conjuction_R", 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_conjuction_R); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_7cBCsWat_3conjuction_R)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_u, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_vessel_index_list, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_out, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_12;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":1710
 *         cdef double w1, w2, x_i, W
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]             # <<<<<<<<<<<<<<
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]
 * 
 */
  __pyx_t_13 = 0;
  __pyx_t_14 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_13)) )));
  __pyx_t_15 = 1;
  __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_15)) )));
  __pyx_t_17 = 2;
  __pyx_t_18 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_17)) )));
  __pyx_t_19 = 3;
  __pyx_t_20 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_19)) )));
  __pyx_v_x1 = __pyx_t_14;
  __pyx_v_x2 = __pyx_t_16;
  __pyx_v_x3 = __pyx_t_18;
  __pyx_v_x4 = __pyx_t_20;

  /* "pylsewave/cynum.pyx":1711
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]             # <<<<<<<<<<<<<<
 * 
 *         #this is better to be improved and instead of shape - 1, last index should be shape
 */
  __pyx_t_21 = 0;
  __pyx_t_12 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_21)) )));
  __pyx_t_22 = 1;
  __pyx_t_23 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_22)) )));
  __pyx_v_d1 = __pyx_t_12;
  __pyx_v_d2 = __pyx_t_23;

  /* "pylsewave/cynum.pyx":1714
 * 
 *         #this is better to be improved and instead of shape - 1, last index should be shape
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 *         first_i = 0
 * 
 */
  __pyx_v_last_i = (((__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1715
 *         #this is better to be improved and instead of shape - 1, last index should be shape
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1
 *         first_i = 0             # <<<<<<<<<<<<<<
 * 
 *         A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3]
 */
  __pyx_v_first_i = 0;

  /* "pylsewave/cynum.pyx":1717
 *         first_i = 0
 * 
 *         A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3]             # <<<<<<<<<<<<<<
 * 
 *         out[0] = -x2 + x4
 */
  __pyx_t_24 = 0;
  __pyx_t_20 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_24)) )));
  __pyx_t_25 = 1;
  __pyx_t_18 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_25)) )));
  __pyx_t_26 = 2;
  __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_26)) )));
  __pyx_t_27 = 3;
  __pyx_t_14 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_27)) )));
  __pyx_v_A_d1 = __pyx_t_20;
  __pyx_v_q_d1 = __pyx_t_18;
  __pyx_v_A_d2 = __pyx_t_16;
  __pyx_v_q_d2 = __pyx_t_14;

  /* "pylsewave/cynum.pyx":1719
 *         A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3]
 * 
 *         out[0] = -x2 + x4             # <<<<<<<<<<<<<<
 *         out[1] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(
 *                   sqrt(x1 / (M_PI*self.vessels[d1].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +
 */
  __pyx_t_28 = 0;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_28)) )) = ((-__pyx_v_x2) + __pyx_v_x4);

  /* "pylsewave/cynum.pyx":1720
 * 
 *         out[0] = -x2 + x4
 *         out[1] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(             # <<<<<<<<<<<<<<
 *                   sqrt(x1 / (M_PI*self.vessels[d1].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(sqrt(x3/ (M_PI*self.vessels[d2].r0[0]**2)) - 1))
 */
  __pyx_t_29 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_29, 1);
  __pyx_t_30 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1721
 *         out[0] = -x2 + x4
 *         out[1] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(
 *                   sqrt(x1 / (M_PI*self.vessels[d1].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +             # <<<<<<<<<<<<<<
 *                   self.vessels[d2].f_r0[0]*(sqrt(x3/ (M_PI*self.vessels[d2].r0[0]**2)) - 1))
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +
 */
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_32 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1722
 *         out[1] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(
 *                   sqrt(x1 / (M_PI*self.vessels[d1].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(sqrt(x3/ (M_PI*self.vessels[d2].r0[0]**2)) - 1))             # <<<<<<<<<<<<<<
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +
 *                   (q_d1/A_d1 + 4*self.pdes.compute_c_i(A_d1, index=last_i-1, vessel_index=d1)))
 */
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_34 = 0;
  __pyx_t_35 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_35, 1);
  __pyx_t_36 = 0;

  /* "pylsewave/cynum.pyx":1720
 * 
 *         out[0] = -x2 + x4
 *         out[1] = (-0.5*self._rho*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(             # <<<<<<<<<<<<<<
 *                   sqrt(x1 / (M_PI*self.vessels[d1].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(sqrt(x3/ (M_PI*self.vessels[d2].r0[0]**2)) - 1))
 */
  __pyx_t_37 = 1;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_37)) )) = (((((-0.5 * __pyx_v_self->__pyx_base._rho) * pow((__pyx_v_x2 / __pyx_v_x1), 2.0)) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_29.data) + __pyx_t_30)) ))) * (sqrt((__pyx_v_x1 / (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_32)) ))), 2.0)))) - 1.0))) + ((0.5 * __pyx_v_self->__pyx_base._rho) * pow((__pyx_v_x4 / __pyx_v_x3), 2.0))) + ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_34)) ))) * (sqrt((__pyx_v_x3 / (M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_35.data) + __pyx_t_36)) ))), 2.0)))) - 1.0)));
  __PYX_XDEC_MEMVIEW(&__pyx_t_29, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1);

  /* "pylsewave/cynum.pyx":1723
 *                   sqrt(x1 / (M_PI*self.vessels[d1].r0[last_i]**2)) - 1) + 0.5*self._rho*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(sqrt(x3/ (M_PI*self.vessels[d2].r0[0]**2)) - 1))
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +             # <<<<<<<<<<<<<<
 *                   (q_d1/A_d1 + 4*self.pdes.compute_c_i(A_d1, index=last_i-1, vessel_index=d1)))
 *         out[3] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d2) +
 */
  __pyx_t_38 = 2;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_38)) )) = ((((-__pyx_v_x2) / __pyx_v_x1) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_x1, __pyx_v_last_i, __pyx_v_d1, 0))) + ((__pyx_v_q_d1 / __pyx_v_A_d1) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_A_d1, (__pyx_v_last_i - 1), __pyx_v_d1, 0))));

  /* "pylsewave/cynum.pyx":1725
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +
 *                   (q_d1/A_d1 + 4*self.pdes.compute_c_i(A_d1, index=last_i-1, vessel_index=d1)))
 *         out[3] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d2) +             # <<<<<<<<<<<<<<
 *                   (q_d2/A_d2 - 4*self.pdes.compute_c_i(A_d2, index=1, vessel_index=d2)))
 * 
 */
  __pyx_t_39 = 3;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_39)) )) = ((((-__pyx_v_x4) / __pyx_v_x3) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_x3, 0, __pyx_v_d2, 0))) + ((__pyx_v_q_d2 / __pyx_v_A_d2) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_A_d2, 1, __pyx_v_d2, 0))));

  /* "pylsewave/cynum.pyx":1728
 *                   (q_d2/A_d2 - 4*self.pdes.compute_c_i(A_d2, index=1, vessel_index=d2)))
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1703
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_R(self, double[::1] x, double[::1] u, double dt, int[::1] vessel_index_list, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef double A_d1, q_d1, A_d2, q_d2
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __PYX_XDEC_MEMVIEW(&__pyx_t_29, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cBCsWat.conjuction_R", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_7cBCsWat_3conjuction_R(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_7cBCsWat_3conjuction_R(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_dt;
  __Pyx_memviewslice __pyx_v_vessel_index_list = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("conjuction_R (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_u,&__pyx_n_s_dt,&__pyx_n_s_vessel_index_list,&__pyx_n_s_out,0};
    PyObject* values[5] = {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  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_u)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 1); __PYX_ERR(0, 1703, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 2); __PYX_ERR(0, 1703, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index_list)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 3); __PYX_ERR(0, 1703, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 4); __PYX_ERR(0, 1703, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conjuction_R") < 0)) __PYX_ERR(0, 1703, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
    }
    __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1703, __pyx_L3_error)
    __pyx_v_u = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 1703, __pyx_L3_error)
    __pyx_v_dt = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1703, __pyx_L3_error)
    __pyx_v_vessel_index_list = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[3]); if (unlikely(!__pyx_v_vessel_index_list.memview)) __PYX_ERR(0, 1703, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[4]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1703, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1703, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cBCsWat.conjuction_R", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_7cBCsWat_2conjuction_R(((struct __pyx_obj_9pylsewave_5cynum_cBCsWat *)__pyx_v_self), __pyx_v_x, __pyx_v_u, __pyx_v_dt, __pyx_v_vessel_index_list, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_7cBCsWat_2conjuction_R(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("conjuction_R", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_9pylsewave_5cynum_7cBCsWat_conjuction_R(__pyx_v_self, __pyx_v_x, __pyx_v_u, __pyx_v_dt, __pyx_v_vessel_index_list, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1703, __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("pylsewave.cynum.cBCsWat.conjuction_R", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_vessel_index_list, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1734
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_Jr(self, double[::1] x, int[::1] vessel_index_list, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef int d1, d2
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_7cBCsWat_5conjuction_Jr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9pylsewave_5cynum_7cBCsWat_conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  int __pyx_v_d1;
  int __pyx_v_d2;
  Py_ssize_t __pyx_v_last_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  double __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  double __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  double __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  double __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  int __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;
  __Pyx_memviewslice __pyx_t_30 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_31;
  __Pyx_memviewslice __pyx_t_32 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  __Pyx_RefNannySetupContext("conjuction_Jr", 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_conjuction_Jr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_7cBCsWat_5conjuction_Jr)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vessel_index_list, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_out, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1734, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_10;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":1739
 *         cdef Py_ssize_t last_i, first_i
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]             # <<<<<<<<<<<<<<
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]
 * 
 */
  __pyx_t_11 = 0;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_11)) )));
  __pyx_t_13 = 1;
  __pyx_t_14 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_13)) )));
  __pyx_t_15 = 2;
  __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_15)) )));
  __pyx_t_17 = 3;
  __pyx_t_18 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_17)) )));
  __pyx_v_x1 = __pyx_t_12;
  __pyx_v_x2 = __pyx_t_14;
  __pyx_v_x3 = __pyx_t_16;
  __pyx_v_x4 = __pyx_t_18;

  /* "pylsewave/cynum.pyx":1740
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]             # <<<<<<<<<<<<<<
 * 
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1
 */
  __pyx_t_19 = 0;
  __pyx_t_10 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_19)) )));
  __pyx_t_20 = 1;
  __pyx_t_21 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_20)) )));
  __pyx_v_d1 = __pyx_t_10;
  __pyx_v_d2 = __pyx_t_21;

  /* "pylsewave/cynum.pyx":1742
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]
 * 
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 * 
 *         out[0, 0] = 0.
 */
  __pyx_v_last_i = (((__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1744
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1
 * 
 *         out[0, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 */
  __pyx_t_22 = 0;
  __pyx_t_23 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_22 * __pyx_v_out.strides[0]) )) + __pyx_t_23)) )) = 0.;

  /* "pylsewave/cynum.pyx":1745
 * 
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.             # <<<<<<<<<<<<<<
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 */
  __pyx_t_24 = 0;
  __pyx_t_25 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_24 * __pyx_v_out.strides[0]) )) + __pyx_t_25)) )) = -1.;

  /* "pylsewave/cynum.pyx":1746
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 3] = 1.
 *         out[1, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[d1].f_r0[last_i]*((M_PI*self.vessels[d1].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 */
  __pyx_t_26 = 0;
  __pyx_t_27 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_26 * __pyx_v_out.strides[0]) )) + __pyx_t_27)) )) = 0.;

  /* "pylsewave/cynum.pyx":1747
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.             # <<<<<<<<<<<<<<
 *         out[1, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[d1].f_r0[last_i]*((M_PI*self.vessels[d1].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 *         out[1, 1] = -self._rho*x2 / x1**2
 */
  __pyx_t_28 = 0;
  __pyx_t_29 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_28 * __pyx_v_out.strides[0]) )) + __pyx_t_29)) )) = 1.;

  /* "pylsewave/cynum.pyx":1748
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 *         out[1, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[d1].f_r0[last_i]*((M_PI*self.vessels[d1].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))             # <<<<<<<<<<<<<<
 *         out[1, 1] = -self._rho*x2 / x1**2
 *         out[1, 2] = -self._rho*(x4**2 / x3**3) + 0.5*self.vessels[d2].f_r0[0]*((M_PI*self.vessels[d2].r0[0]**2)**(-0.5))*(x3**(-1/2.))
 */
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_31 = __pyx_v_last_i;
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_33 = __pyx_v_last_i;
  __pyx_t_34 = 1;
  __pyx_t_35 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_34 * __pyx_v_out.strides[0]) )) + __pyx_t_35)) )) = ((__pyx_v_self->__pyx_base._rho * (pow(__pyx_v_x2, 2.0) / pow(__pyx_v_x1, 3.0))) - (((0.5 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_31)) )))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_33)) ))), 2.0)), -0.5)) * pow(__pyx_v_x1, (-1.0 / 2.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);

  /* "pylsewave/cynum.pyx":1749
 *         out[0, 3] = 1.
 *         out[1, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[d1].f_r0[last_i]*((M_PI*self.vessels[d1].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 *         out[1, 1] = -self._rho*x2 / x1**2             # <<<<<<<<<<<<<<
 *         out[1, 2] = -self._rho*(x4**2 / x3**3) + 0.5*self.vessels[d2].f_r0[0]*((M_PI*self.vessels[d2].r0[0]**2)**(-0.5))*(x3**(-1/2.))
 *         out[1, 3] =  self._rho*x4 / x3**2
 */
  __pyx_t_36 = 1;
  __pyx_t_37 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_36 * __pyx_v_out.strides[0]) )) + __pyx_t_37)) )) = (((-__pyx_v_self->__pyx_base._rho) * __pyx_v_x2) / pow(__pyx_v_x1, 2.0));

  /* "pylsewave/cynum.pyx":1750
 *         out[1, 0] = self._rho*(x2**2 / x1**3) - 0.5*self.vessels[d1].f_r0[last_i]*((M_PI*self.vessels[d1].r0[last_i]**2)**(-0.5))*(x1**(-1/2.))
 *         out[1, 1] = -self._rho*x2 / x1**2
 *         out[1, 2] = -self._rho*(x4**2 / x3**3) + 0.5*self.vessels[d2].f_r0[0]*((M_PI*self.vessels[d2].r0[0]**2)**(-0.5))*(x3**(-1/2.))             # <<<<<<<<<<<<<<
 *         out[1, 3] =  self._rho*x4 / x3**2
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d1].f_r0[last_i] / sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-3/4.)
 */
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_38 = 0;
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_39 = 0;
  __pyx_t_40 = 1;
  __pyx_t_41 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_40 * __pyx_v_out.strides[0]) )) + __pyx_t_41)) )) = (((-__pyx_v_self->__pyx_base._rho) * (pow(__pyx_v_x4, 2.0) / pow(__pyx_v_x3, 3.0))) + (((0.5 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_38)) )))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_39)) ))), 2.0)), -0.5)) * pow(__pyx_v_x3, (-1.0 / 2.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);

  /* "pylsewave/cynum.pyx":1751
 *         out[1, 1] = -self._rho*x2 / x1**2
 *         out[1, 2] = -self._rho*(x4**2 / x3**3) + 0.5*self.vessels[d2].f_r0[0]*((M_PI*self.vessels[d2].r0[0]**2)**(-0.5))*(x3**(-1/2.))
 *         out[1, 3] =  self._rho*x4 / x3**2             # <<<<<<<<<<<<<<
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d1].f_r0[last_i] / sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-3/4.)
 *         out[2, 1] = -1./x1
 */
  __pyx_t_42 = 1;
  __pyx_t_43 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_42 * __pyx_v_out.strides[0]) )) + __pyx_t_43)) )) = ((__pyx_v_self->__pyx_base._rho * __pyx_v_x4) / pow(__pyx_v_x3, 2.0));

  /* "pylsewave/cynum.pyx":1752
 *         out[1, 2] = -self._rho*(x4**2 / x3**3) + 0.5*self.vessels[d2].f_r0[0]*((M_PI*self.vessels[d2].r0[0]**2)**(-0.5))*(x3**(-1/2.))
 *         out[1, 3] =  self._rho*x4 / x3**2
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d1].f_r0[last_i] / sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-3/4.)             # <<<<<<<<<<<<<<
 *         out[2, 1] = -1./x1
 *         out[2, 2] = 0.
 */
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_44 = __pyx_v_last_i;
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_45 = __pyx_v_last_i;
  __pyx_t_46 = 2;
  __pyx_t_47 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_46 * __pyx_v_out.strides[0]) )) + __pyx_t_47)) )) = ((__pyx_v_x2 / pow(__pyx_v_x1, 2.0)) - ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_self->__pyx_base._rho) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_44)) )))) / sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_45)) ))), 2.0))))))) * pow(__pyx_v_x1, (-3.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);

  /* "pylsewave/cynum.pyx":1753
 *         out[1, 3] =  self._rho*x4 / x3**2
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d1].f_r0[last_i] / sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-3/4.)
 *         out[2, 1] = -1./x1             # <<<<<<<<<<<<<<
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 */
  __pyx_t_48 = 2;
  __pyx_t_49 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_48 * __pyx_v_out.strides[0]) )) + __pyx_t_49)) )) = (-1. / __pyx_v_x1);

  /* "pylsewave/cynum.pyx":1754
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d1].f_r0[last_i] / sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-3/4.)
 *         out[2, 1] = -1./x1
 *         out[2, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 3] = 0.
 *         out[3, 0] = 0.
 */
  __pyx_t_50 = 2;
  __pyx_t_51 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_50 * __pyx_v_out.strides[0]) )) + __pyx_t_51)) )) = 0.;

  /* "pylsewave/cynum.pyx":1755
 *         out[2, 1] = -1./x1
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 0] = 0.
 *         out[3, 1] = 0.
 */
  __pyx_t_52 = 2;
  __pyx_t_53 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_52 * __pyx_v_out.strides[0]) )) + __pyx_t_53)) )) = 0.;

  /* "pylsewave/cynum.pyx":1756
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 *         out[3, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 1] = 0.
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d2].f_r0[0] / sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-3/4.)
 */
  __pyx_t_54 = 3;
  __pyx_t_55 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_54 * __pyx_v_out.strides[0]) )) + __pyx_t_55)) )) = 0.;

  /* "pylsewave/cynum.pyx":1757
 *         out[2, 3] = 0.
 *         out[3, 0] = 0.
 *         out[3, 1] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d2].f_r0[0] / sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-3/4.)
 *         out[3, 3] = -1./x3
 */
  __pyx_t_56 = 3;
  __pyx_t_57 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_56 * __pyx_v_out.strides[0]) )) + __pyx_t_57)) )) = 0.;

  /* "pylsewave/cynum.pyx":1758
 *         out[3, 0] = 0.
 *         out[3, 1] = 0.
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d2].f_r0[0] / sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-3/4.)             # <<<<<<<<<<<<<<
 *         out[3, 3] = -1./x3
 * 
 */
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_58 = 0;
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_59 = 0;
  __pyx_t_60 = 3;
  __pyx_t_61 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_60 * __pyx_v_out.strides[0]) )) + __pyx_t_61)) )) = ((__pyx_v_x4 / pow(__pyx_v_x3, 2.0)) + ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_self->__pyx_base._rho) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_58)) )))) / sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_59)) ))), 2.0))))))) * pow(__pyx_v_x3, (-3.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);

  /* "pylsewave/cynum.pyx":1759
 *         out[3, 1] = 0.
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/self._rho)*self.vessels[d2].f_r0[0] / sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-3/4.)
 *         out[3, 3] = -1./x3             # <<<<<<<<<<<<<<
 * 
 *         return STATUS_OK
 */
  __pyx_t_62 = 3;
  __pyx_t_63 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_62 * __pyx_v_out.strides[0]) )) + __pyx_t_63)) )) = (-1. / __pyx_v_x3);

  /* "pylsewave/cynum.pyx":1761
 *         out[3, 3] = -1./x3
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1734
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_Jr(self, double[::1] x, int[::1] vessel_index_list, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef int d1, d2
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cBCsWat.conjuction_Jr", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_7cBCsWat_5conjuction_Jr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_7cBCsWat_5conjuction_Jr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vessel_index_list = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("conjuction_Jr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_vessel_index_list,&__pyx_n_s_out,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_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index_list)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_Jr", 1, 3, 3, 1); __PYX_ERR(0, 1734, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_Jr", 1, 3, 3, 2); __PYX_ERR(0, 1734, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conjuction_Jr") < 0)) __PYX_ERR(0, 1734, __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_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1734, __pyx_L3_error)
    __pyx_v_vessel_index_list = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[1]); if (unlikely(!__pyx_v_vessel_index_list.memview)) __PYX_ERR(0, 1734, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[2]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1734, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("conjuction_Jr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1734, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cBCsWat.conjuction_Jr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_7cBCsWat_4conjuction_Jr(((struct __pyx_obj_9pylsewave_5cynum_cBCsWat *)__pyx_v_self), __pyx_v_x, __pyx_v_vessel_index_list, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_7cBCsWat_4conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_cBCsWat *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("conjuction_Jr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_9pylsewave_5cynum_7cBCsWat_conjuction_Jr(__pyx_v_self, __pyx_v_x, __pyx_v_vessel_index_list, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1734, __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("pylsewave.cynum.cBCsWat.conjuction_Jr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_vessel_index_list, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1771
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_R(self, double[::1] x, double[::1] u, double dt, int[::1] vessel_index_list, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, x5, x6
 *         cdef int p, d1, d2
 */

static int __pyx_f_9pylsewave_5cynum_5BCsSc_bifurcation_R(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  double __pyx_v_x5;
  double __pyx_v_x6;
  int __pyx_v_p;
  int __pyx_v_d1;
  int __pyx_v_d2;
  double __pyx_v_A_p;
  double __pyx_v_q_p;
  double __pyx_v_A_d1;
  double __pyx_v_q_d1;
  double __pyx_v_A_d2;
  double __pyx_v_q_d2;
  double __pyx_v_rho_;
  Py_ssize_t __pyx_v_last_i;
  Py_ssize_t __pyx_v_first_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  double __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  double __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  double __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  double __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  double __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  double __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __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;
  __Pyx_memviewslice __pyx_t_26 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_27;
  __Pyx_memviewslice __pyx_t_28 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_29;
  __Pyx_memviewslice __pyx_t_30 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_31;
  __Pyx_memviewslice __pyx_t_32 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  __Pyx_RefNannySetupContext("bifurcation_R", 0);

  /* "pylsewave/cynum.pyx":1779
 *         cdef double w1, w2, x_i, W
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]             # <<<<<<<<<<<<<<
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]
 */
  __pyx_t_1 = 0;
  __pyx_t_2 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_1)) )));
  __pyx_t_3 = 1;
  __pyx_t_4 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_3)) )));
  __pyx_t_5 = 2;
  __pyx_t_6 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_5)) )));
  __pyx_t_7 = 3;
  __pyx_t_8 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_7)) )));
  __pyx_t_9 = 4;
  __pyx_t_10 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_9)) )));
  __pyx_t_11 = 5;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_11)) )));
  __pyx_v_x1 = __pyx_t_2;
  __pyx_v_x2 = __pyx_t_4;
  __pyx_v_x3 = __pyx_t_6;
  __pyx_v_x4 = __pyx_t_8;
  __pyx_v_x5 = __pyx_t_10;
  __pyx_v_x6 = __pyx_t_12;

  /* "pylsewave/cynum.pyx":1780
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]             # <<<<<<<<<<<<<<
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]
 *         rho_ = 1.
 */
  __pyx_t_13 = 0;
  __pyx_t_14 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_13)) )));
  __pyx_t_15 = 1;
  __pyx_t_16 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_15)) )));
  __pyx_t_17 = 2;
  __pyx_t_18 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_17)) )));
  __pyx_v_p = __pyx_t_14;
  __pyx_v_d1 = __pyx_t_16;
  __pyx_v_d2 = __pyx_t_18;

  /* "pylsewave/cynum.pyx":1781
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]             # <<<<<<<<<<<<<<
 *         rho_ = 1.
 * 
 */
  __pyx_t_19 = 0;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_19)) )));
  __pyx_t_20 = 1;
  __pyx_t_10 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_20)) )));
  __pyx_t_21 = 2;
  __pyx_t_8 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_21)) )));
  __pyx_t_22 = 3;
  __pyx_t_6 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_22)) )));
  __pyx_t_23 = 4;
  __pyx_t_4 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_23)) )));
  __pyx_t_24 = 5;
  __pyx_t_2 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_24)) )));
  __pyx_v_A_p = __pyx_t_12;
  __pyx_v_q_p = __pyx_t_10;
  __pyx_v_A_d1 = __pyx_t_8;
  __pyx_v_q_d1 = __pyx_t_6;
  __pyx_v_A_d2 = __pyx_t_4;
  __pyx_v_q_d2 = __pyx_t_2;

  /* "pylsewave/cynum.pyx":1782
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 *         A_p, q_p, A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3], u[4], u[5]
 *         rho_ = 1.             # <<<<<<<<<<<<<<
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 */
  __pyx_v_rho_ = 1.;

  /* "pylsewave/cynum.pyx":1784
 *         rho_ = 1.
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 *         first_i = 0
 * 
 */
  __pyx_v_last_i = (((__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1785
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 *         first_i = 0             # <<<<<<<<<<<<<<
 * 
 *         out[0] = -x2 + x4 + x6
 */
  __pyx_v_first_i = 0;

  /* "pylsewave/cynum.pyx":1787
 *         first_i = 0
 * 
 *         out[0] = -x2 + x4 + x6             # <<<<<<<<<<<<<<
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 */
  __pyx_t_25 = 0;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_25)) )) = (((-__pyx_v_x2) + __pyx_v_x4) + __pyx_v_x6);

  /* "pylsewave/cynum.pyx":1788
 * 
 *         out[0] = -x2 + x4 + x6
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 */
  __pyx_t_26 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_26, 1);
  __pyx_t_27 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1789
 *         out[0] = -x2 + x4 + x6
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +             # <<<<<<<<<<<<<<
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 */
  __pyx_t_28 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
  __pyx_t_29 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1790
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))             # <<<<<<<<<<<<<<
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +
 */
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_31 = __pyx_v_first_i;
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_33 = 0;

  /* "pylsewave/cynum.pyx":1788
 * 
 *         out[0] = -x2 + x4 + x6
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 */
  __pyx_t_34 = 1;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_34)) )) = (((((-0.5 * __pyx_v_rho_) * pow((__pyx_v_x2 / __pyx_v_x1), 2.0)) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_26.data) + __pyx_t_27)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_28.data) + __pyx_t_29)) ))), 2.0)) / __pyx_v_x1))))) + ((0.5 * __pyx_v_rho_) * pow((__pyx_v_x4 / __pyx_v_x3), 2.0))) + ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_31)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_33)) ))), 2.0)) / __pyx_v_x3)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);

  /* "pylsewave/cynum.pyx":1791
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x5)))
 */
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_35 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1792
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +             # <<<<<<<<<<<<<<
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x5)))
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +
 */
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_36 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1793
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x5)))             # <<<<<<<<<<<<<<
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +
 *                   (q_p/A_p + 4*self.pdes.compute_c_i(A_p, index=last_i-1, vessel_index=p)))
 */
  __pyx_t_28 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
  __pyx_t_37 = 0;
  __pyx_t_26 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_26, 1);
  __pyx_t_38 = 0;

  /* "pylsewave/cynum.pyx":1791
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d1].f_r0[first_i]*(1 - sqrt(M_PI*self.vessels[d1].r0[0]**2 / x3)))
 *         out[2] = (-0.5*rho_*(x2/x1)**2 - self.vessels[p].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x5)))
 */
  __pyx_t_39 = 2;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_39)) )) = (((((-0.5 * __pyx_v_rho_) * pow((__pyx_v_x2 / __pyx_v_x1), 2.0)) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_35)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_36)) ))), 2.0)) / __pyx_v_x1))))) + ((0.5 * __pyx_v_rho_) * pow((__pyx_v_x6 / __pyx_v_x5), 2.0))) + ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_28.data) + __pyx_t_37)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_26.data) + __pyx_t_38)) ))), 2.0)) / __pyx_v_x5)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);

  /* "pylsewave/cynum.pyx":1794
 *                   sqrt(M_PI*self.vessels[p].r0[last_i]**2 / x1)) + 0.5*rho_*(x6/x5)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x5)))
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +             # <<<<<<<<<<<<<<
 *                   (q_p/A_p + 4*self.pdes.compute_c_i(A_p, index=last_i-1, vessel_index=p)))
 *         out[4] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d1) +
 */
  __pyx_t_40 = 3;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_40)) )) = ((((-__pyx_v_x2) / __pyx_v_x1) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_x1, __pyx_v_last_i, __pyx_v_p, 0))) + ((__pyx_v_q_p / __pyx_v_A_p) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_A_p, (__pyx_v_last_i - 1), __pyx_v_p, 0))));

  /* "pylsewave/cynum.pyx":1796
 *         out[3] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=p) +
 *                   (q_p/A_p + 4*self.pdes.compute_c_i(A_p, index=last_i-1, vessel_index=p)))
 *         out[4] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d1) +             # <<<<<<<<<<<<<<
 *                   (q_d1/A_d1 - 4*self.pdes.compute_c_i(A_d1, index=1, vessel_index=d1)))
 *         out[5] = (-x6/x5 + 4*self.pdes.compute_c_i(x5, index=0, vessel_index=d2) +
 */
  __pyx_t_41 = 4;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_41)) )) = ((((-__pyx_v_x4) / __pyx_v_x3) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_x3, 0, __pyx_v_d1, 0))) + ((__pyx_v_q_d1 / __pyx_v_A_d1) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_A_d1, 1, __pyx_v_d1, 0))));

  /* "pylsewave/cynum.pyx":1798
 *         out[4] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d1) +
 *                   (q_d1/A_d1 - 4*self.pdes.compute_c_i(A_d1, index=1, vessel_index=d1)))
 *         out[5] = (-x6/x5 + 4*self.pdes.compute_c_i(x5, index=0, vessel_index=d2) +             # <<<<<<<<<<<<<<
 *                   (q_d2/A_d2 - 4*self.pdes.compute_c_i(A_d2, index=1, vessel_index=d2)))
 * 
 */
  __pyx_t_42 = 5;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_42)) )) = ((((-__pyx_v_x6) / __pyx_v_x5) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_x5, 0, __pyx_v_d2, 0))) + ((__pyx_v_q_d2 / __pyx_v_A_d2) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_A_d2, 1, __pyx_v_d2, 0))));

  /* "pylsewave/cynum.pyx":1801
 *                   (q_d2/A_d2 - 4*self.pdes.compute_c_i(A_d2, index=1, vessel_index=d2)))
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1771
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_R(self, double[::1] x, double[::1] u, double dt, int[::1] vessel_index_list, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, x5, x6
 *         cdef int p, d1, d2
 */

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

/* "pylsewave/cynum.pyx":1807
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_Jr(self, double[::1] x, int[::1] vessel_index_list, double[:, ::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, x5, x6, rho_
 *         cdef int p, d1, d2
 */

static int __pyx_f_9pylsewave_5cynum_5BCsSc_bifurcation_Jr(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  double __pyx_v_x5;
  double __pyx_v_x6;
  double __pyx_v_rho_;
  int __pyx_v_p;
  int __pyx_v_d1;
  int __pyx_v_d2;
  Py_ssize_t __pyx_v_last_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_first_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  double __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  double __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  double __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  double __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  double __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  double __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __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;
  Py_ssize_t __pyx_t_30;
  __Pyx_memviewslice __pyx_t_31 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_32;
  __Pyx_memviewslice __pyx_t_33 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  Py_ssize_t __pyx_t_64;
  Py_ssize_t __pyx_t_65;
  Py_ssize_t __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  Py_ssize_t __pyx_t_70;
  Py_ssize_t __pyx_t_71;
  Py_ssize_t __pyx_t_72;
  Py_ssize_t __pyx_t_73;
  Py_ssize_t __pyx_t_74;
  Py_ssize_t __pyx_t_75;
  Py_ssize_t __pyx_t_76;
  Py_ssize_t __pyx_t_77;
  Py_ssize_t __pyx_t_78;
  Py_ssize_t __pyx_t_79;
  Py_ssize_t __pyx_t_80;
  Py_ssize_t __pyx_t_81;
  Py_ssize_t __pyx_t_82;
  Py_ssize_t __pyx_t_83;
  Py_ssize_t __pyx_t_84;
  Py_ssize_t __pyx_t_85;
  Py_ssize_t __pyx_t_86;
  Py_ssize_t __pyx_t_87;
  Py_ssize_t __pyx_t_88;
  Py_ssize_t __pyx_t_89;
  Py_ssize_t __pyx_t_90;
  Py_ssize_t __pyx_t_91;
  Py_ssize_t __pyx_t_92;
  Py_ssize_t __pyx_t_93;
  Py_ssize_t __pyx_t_94;
  Py_ssize_t __pyx_t_95;
  Py_ssize_t __pyx_t_96;
  Py_ssize_t __pyx_t_97;
  Py_ssize_t __pyx_t_98;
  Py_ssize_t __pyx_t_99;
  Py_ssize_t __pyx_t_100;
  Py_ssize_t __pyx_t_101;
  Py_ssize_t __pyx_t_102;
  Py_ssize_t __pyx_t_103;
  Py_ssize_t __pyx_t_104;
  Py_ssize_t __pyx_t_105;
  Py_ssize_t __pyx_t_106;
  __Pyx_RefNannySetupContext("bifurcation_Jr", 0);

  /* "pylsewave/cynum.pyx":1812
 *         cdef Py_ssize_t last_i, first_i
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]             # <<<<<<<<<<<<<<
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 * 
 */
  __pyx_t_1 = 0;
  __pyx_t_2 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_1)) )));
  __pyx_t_3 = 1;
  __pyx_t_4 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_3)) )));
  __pyx_t_5 = 2;
  __pyx_t_6 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_5)) )));
  __pyx_t_7 = 3;
  __pyx_t_8 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_7)) )));
  __pyx_t_9 = 4;
  __pyx_t_10 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_9)) )));
  __pyx_t_11 = 5;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_11)) )));
  __pyx_v_x1 = __pyx_t_2;
  __pyx_v_x2 = __pyx_t_4;
  __pyx_v_x3 = __pyx_t_6;
  __pyx_v_x4 = __pyx_t_8;
  __pyx_v_x5 = __pyx_t_10;
  __pyx_v_x6 = __pyx_t_12;

  /* "pylsewave/cynum.pyx":1813
 * 
 *         x1, x2, x3, x4, x5, x6 = x[0], x[1], x[2], x[3], x[4], x[5]
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]             # <<<<<<<<<<<<<<
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 */
  __pyx_t_13 = 0;
  __pyx_t_14 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_13)) )));
  __pyx_t_15 = 1;
  __pyx_t_16 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_15)) )));
  __pyx_t_17 = 2;
  __pyx_t_18 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_17)) )));
  __pyx_v_p = __pyx_t_14;
  __pyx_v_d1 = __pyx_t_16;
  __pyx_v_d2 = __pyx_t_18;

  /* "pylsewave/cynum.pyx":1815
 *         p, d1, d2 = vessel_index_list[0], vessel_index_list[1], vessel_index_list[2]
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 *         first_i = 0
 * 
 */
  __pyx_v_last_i = (((__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1816
 * 
 *         last_i = self.vessels[p].f_r0.shape[0] - 1
 *         first_i = 0             # <<<<<<<<<<<<<<
 * 
 *         rho_ = 1.
 */
  __pyx_v_first_i = 0;

  /* "pylsewave/cynum.pyx":1818
 *         first_i = 0
 * 
 *         rho_ = 1.             # <<<<<<<<<<<<<<
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.
 */
  __pyx_v_rho_ = 1.;

  /* "pylsewave/cynum.pyx":1819
 * 
 *         rho_ = 1.
 *         out[0, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 */
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) )) + __pyx_t_20)) )) = 0.;

  /* "pylsewave/cynum.pyx":1820
 *         rho_ = 1.
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.             # <<<<<<<<<<<<<<
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 */
  __pyx_t_21 = 0;
  __pyx_t_22 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_21 * __pyx_v_out.strides[0]) )) + __pyx_t_22)) )) = -1.;

  /* "pylsewave/cynum.pyx":1821
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 3] = 1.
 *         out[0, 4] = 0.
 */
  __pyx_t_23 = 0;
  __pyx_t_24 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_23 * __pyx_v_out.strides[0]) )) + __pyx_t_24)) )) = 0.;

  /* "pylsewave/cynum.pyx":1822
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.             # <<<<<<<<<<<<<<
 *         out[0, 4] = 0.
 *         out[0, 5] = 1.
 */
  __pyx_t_25 = 0;
  __pyx_t_26 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_25 * __pyx_v_out.strides[0]) )) + __pyx_t_26)) )) = 1.;

  /* "pylsewave/cynum.pyx":1823
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 *         out[0, 4] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 5] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 */
  __pyx_t_27 = 0;
  __pyx_t_28 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_27 * __pyx_v_out.strides[0]) )) + __pyx_t_28)) )) = 0.;

  /* "pylsewave/cynum.pyx":1824
 *         out[0, 3] = 1.
 *         out[0, 4] = 0.
 *         out[0, 5] = 1.             # <<<<<<<<<<<<<<
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2
 */
  __pyx_t_29 = 0;
  __pyx_t_30 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_29 * __pyx_v_out.strides[0]) )) + __pyx_t_30)) )) = 1.;

  /* "pylsewave/cynum.pyx":1825
 *         out[0, 4] = 0.
 *         out[0, 5] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))             # <<<<<<<<<<<<<<
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d1].f_r0[0]*(M_PI*self.vessels[d1].r0[0]**2)**0.5 / (2*x3**(3/2.))
 */
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_32 = __pyx_v_last_i;
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_34 = __pyx_v_last_i;
  __pyx_t_35 = 1;
  __pyx_t_36 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_35 * __pyx_v_out.strides[0]) )) + __pyx_t_36)) )) = ((__pyx_v_rho_ * (pow(__pyx_v_x2, 2.0) / pow(__pyx_v_x1, 3.0))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_32)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_34)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x1, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1826
 *         out[0, 5] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2             # <<<<<<<<<<<<<<
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d1].f_r0[0]*(M_PI*self.vessels[d1].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2
 */
  __pyx_t_37 = 1;
  __pyx_t_38 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_37 * __pyx_v_out.strides[0]) )) + __pyx_t_38)) )) = (((-__pyx_v_rho_) * __pyx_v_x2) / pow(__pyx_v_x1, 2.0));

  /* "pylsewave/cynum.pyx":1827
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d1].f_r0[0]*(M_PI*self.vessels[d1].r0[0]**2)**0.5 / (2*x3**(3/2.))             # <<<<<<<<<<<<<<
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[1, 4] = 0.
 */
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_39 = 0;
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_40 = 0;
  __pyx_t_41 = 1;
  __pyx_t_42 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_41 * __pyx_v_out.strides[0]) )) + __pyx_t_42)) )) = (((-__pyx_v_rho_) * (pow(__pyx_v_x4, 2.0) / pow(__pyx_v_x3, 3.0))) + (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_39)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_40)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x3, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);

  /* "pylsewave/cynum.pyx":1828
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d1].f_r0[0]*(M_PI*self.vessels[d1].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2             # <<<<<<<<<<<<<<
 *         out[1, 4] = 0.
 *         out[1, 5] = 0.
 */
  __pyx_t_43 = 1;
  __pyx_t_44 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_43 * __pyx_v_out.strides[0]) )) + __pyx_t_44)) )) = ((__pyx_v_rho_ * __pyx_v_x4) / pow(__pyx_v_x3, 2.0));

  /* "pylsewave/cynum.pyx":1829
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d1].f_r0[0]*(M_PI*self.vessels[d1].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[1, 4] = 0.             # <<<<<<<<<<<<<<
 *         out[1, 5] = 0.
 *         out[2, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 */
  __pyx_t_45 = 1;
  __pyx_t_46 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_45 * __pyx_v_out.strides[0]) )) + __pyx_t_46)) )) = 0.;

  /* "pylsewave/cynum.pyx":1830
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[1, 4] = 0.
 *         out[1, 5] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[2, 1] = -rho_*x2 / x1**2
 */
  __pyx_t_47 = 1;
  __pyx_t_48 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_47 * __pyx_v_out.strides[0]) )) + __pyx_t_48)) )) = 0.;

  /* "pylsewave/cynum.pyx":1831
 *         out[1, 4] = 0.
 *         out[1, 5] = 0.
 *         out[2, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))             # <<<<<<<<<<<<<<
 *         out[2, 1] = -rho_*x2 / x1**2
 *         out[2, 2] = 0.
 */
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_49 = __pyx_v_last_i;
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_50 = __pyx_v_last_i;
  __pyx_t_51 = 2;
  __pyx_t_52 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_51 * __pyx_v_out.strides[0]) )) + __pyx_t_52)) )) = ((__pyx_v_rho_ * (pow(__pyx_v_x2, 2.0) / pow(__pyx_v_x1, 3.0))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_49)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_50)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x1, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1832
 *         out[1, 5] = 0.
 *         out[2, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[2, 1] = -rho_*x2 / x1**2             # <<<<<<<<<<<<<<
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 */
  __pyx_t_53 = 2;
  __pyx_t_54 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_53 * __pyx_v_out.strides[0]) )) + __pyx_t_54)) )) = (((-__pyx_v_rho_) * __pyx_v_x2) / pow(__pyx_v_x1, 2.0));

  /* "pylsewave/cynum.pyx":1833
 *         out[2, 0] = rho_*(x2**2 / x1**3) - self.vessels[p].f_r0[last_i]*(M_PI*self.vessels[p].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[2, 1] = -rho_*x2 / x1**2
 *         out[2, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 3] = 0.
 *         out[2, 4] = -rho_*(x6**2 / x5**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x5**(3/2.))
 */
  __pyx_t_55 = 2;
  __pyx_t_56 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_55 * __pyx_v_out.strides[0]) )) + __pyx_t_56)) )) = 0.;

  /* "pylsewave/cynum.pyx":1834
 *         out[2, 1] = -rho_*x2 / x1**2
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 4] = -rho_*(x6**2 / x5**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x5**(3/2.))
 *         out[2, 5] = rho_*x6 / x5**2
 */
  __pyx_t_57 = 2;
  __pyx_t_58 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_57 * __pyx_v_out.strides[0]) )) + __pyx_t_58)) )) = 0.;

  /* "pylsewave/cynum.pyx":1835
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 *         out[2, 4] = -rho_*(x6**2 / x5**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x5**(3/2.))             # <<<<<<<<<<<<<<
 *         out[2, 5] = rho_*x6 / x5**2
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[p].f_r0[last_i]*sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-5/4.)
 */
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_59 = 0;
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_60 = 0;
  __pyx_t_61 = 2;
  __pyx_t_62 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_61 * __pyx_v_out.strides[0]) )) + __pyx_t_62)) )) = (((-__pyx_v_rho_) * (pow(__pyx_v_x6, 2.0) / pow(__pyx_v_x5, 3.0))) + (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_59)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_60)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x5, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);

  /* "pylsewave/cynum.pyx":1836
 *         out[2, 3] = 0.
 *         out[2, 4] = -rho_*(x6**2 / x5**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x5**(3/2.))
 *         out[2, 5] = rho_*x6 / x5**2             # <<<<<<<<<<<<<<
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[p].f_r0[last_i]*sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-5/4.)
 *         out[3, 1] = -1./x1
 */
  __pyx_t_63 = 2;
  __pyx_t_64 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_63 * __pyx_v_out.strides[0]) )) + __pyx_t_64)) )) = ((__pyx_v_rho_ * __pyx_v_x6) / pow(__pyx_v_x5, 2.0));

  /* "pylsewave/cynum.pyx":1837
 *         out[2, 4] = -rho_*(x6**2 / x5**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x5**(3/2.))
 *         out[2, 5] = rho_*x6 / x5**2
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[p].f_r0[last_i]*sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-5/4.)             # <<<<<<<<<<<<<<
 *         out[3, 1] = -1./x1
 *         out[3, 2] = 0.
 */
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_65 = __pyx_v_last_i;
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_p]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_66 = __pyx_v_last_i;
  __pyx_t_67 = 3;
  __pyx_t_68 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_67 * __pyx_v_out.strides[0]) )) + __pyx_t_68)) )) = ((__pyx_v_x2 / pow(__pyx_v_x1, 2.0)) - ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_rho_) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_65)) )))) * sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_66)) ))), 2.0))))))) * pow(__pyx_v_x1, (-5.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1838
 *         out[2, 5] = rho_*x6 / x5**2
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[p].f_r0[last_i]*sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-5/4.)
 *         out[3, 1] = -1./x1             # <<<<<<<<<<<<<<
 *         out[3, 2] = 0.
 *         out[3, 3] = 0.0
 */
  __pyx_t_69 = 3;
  __pyx_t_70 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_69 * __pyx_v_out.strides[0]) )) + __pyx_t_70)) )) = (-1. / __pyx_v_x1);

  /* "pylsewave/cynum.pyx":1839
 *         out[3, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[p].f_r0[last_i]*sqrt(M_PI*self.vessels[p].r0[last_i]**2)))*x1**(-5/4.)
 *         out[3, 1] = -1./x1
 *         out[3, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 3] = 0.0
 *         out[3, 4] = 0.
 */
  __pyx_t_71 = 3;
  __pyx_t_72 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_71 * __pyx_v_out.strides[0]) )) + __pyx_t_72)) )) = 0.;

  /* "pylsewave/cynum.pyx":1840
 *         out[3, 1] = -1./x1
 *         out[3, 2] = 0.
 *         out[3, 3] = 0.0             # <<<<<<<<<<<<<<
 *         out[3, 4] = 0.
 *         out[3, 5] = 0.
 */
  __pyx_t_73 = 3;
  __pyx_t_74 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_73 * __pyx_v_out.strides[0]) )) + __pyx_t_74)) )) = 0.0;

  /* "pylsewave/cynum.pyx":1841
 *         out[3, 2] = 0.
 *         out[3, 3] = 0.0
 *         out[3, 4] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 5] = 0.
 *         out[4, 0] = 0.0
 */
  __pyx_t_75 = 3;
  __pyx_t_76 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_75 * __pyx_v_out.strides[0]) )) + __pyx_t_76)) )) = 0.;

  /* "pylsewave/cynum.pyx":1842
 *         out[3, 3] = 0.0
 *         out[3, 4] = 0.
 *         out[3, 5] = 0.             # <<<<<<<<<<<<<<
 *         out[4, 0] = 0.0
 *         out[4, 1] = 0.
 */
  __pyx_t_77 = 3;
  __pyx_t_78 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_77 * __pyx_v_out.strides[0]) )) + __pyx_t_78)) )) = 0.;

  /* "pylsewave/cynum.pyx":1843
 *         out[3, 4] = 0.
 *         out[3, 5] = 0.
 *         out[4, 0] = 0.0             # <<<<<<<<<<<<<<
 *         out[4, 1] = 0.
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[0]*sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-5/4.)
 */
  __pyx_t_79 = 4;
  __pyx_t_80 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_79 * __pyx_v_out.strides[0]) )) + __pyx_t_80)) )) = 0.0;

  /* "pylsewave/cynum.pyx":1844
 *         out[3, 5] = 0.
 *         out[4, 0] = 0.0
 *         out[4, 1] = 0.             # <<<<<<<<<<<<<<
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[0]*sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-5/4.)
 *         out[4, 3] = -1./x3
 */
  __pyx_t_81 = 4;
  __pyx_t_82 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_81 * __pyx_v_out.strides[0]) )) + __pyx_t_82)) )) = 0.;

  /* "pylsewave/cynum.pyx":1845
 *         out[4, 0] = 0.0
 *         out[4, 1] = 0.
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[0]*sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-5/4.)             # <<<<<<<<<<<<<<
 *         out[4, 3] = -1./x3
 *         out[4, 4] = 0.
 */
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_83 = 0;
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_84 = 0;
  __pyx_t_85 = 4;
  __pyx_t_86 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_85 * __pyx_v_out.strides[0]) )) + __pyx_t_86)) )) = ((__pyx_v_x4 / pow(__pyx_v_x3, 2.0)) + ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_rho_) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_83)) )))) * sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_84)) ))), 2.0))))))) * pow(__pyx_v_x3, (-5.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);

  /* "pylsewave/cynum.pyx":1846
 *         out[4, 1] = 0.
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[0]*sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-5/4.)
 *         out[4, 3] = -1./x3             # <<<<<<<<<<<<<<
 *         out[4, 4] = 0.
 *         out[4, 5] = 0.
 */
  __pyx_t_87 = 4;
  __pyx_t_88 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_87 * __pyx_v_out.strides[0]) )) + __pyx_t_88)) )) = (-1. / __pyx_v_x3);

  /* "pylsewave/cynum.pyx":1847
 *         out[4, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[0]*sqrt(M_PI*self.vessels[d1].r0[0]**2)))*x3**(-5/4.)
 *         out[4, 3] = -1./x3
 *         out[4, 4] = 0.             # <<<<<<<<<<<<<<
 *         out[4, 5] = 0.
 *         out[5, 0] = 0.
 */
  __pyx_t_89 = 4;
  __pyx_t_90 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_89 * __pyx_v_out.strides[0]) )) + __pyx_t_90)) )) = 0.;

  /* "pylsewave/cynum.pyx":1848
 *         out[4, 3] = -1./x3
 *         out[4, 4] = 0.
 *         out[4, 5] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 0] = 0.
 *         out[5, 1] = 0.
 */
  __pyx_t_91 = 4;
  __pyx_t_92 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_91 * __pyx_v_out.strides[0]) )) + __pyx_t_92)) )) = 0.;

  /* "pylsewave/cynum.pyx":1849
 *         out[4, 4] = 0.
 *         out[4, 5] = 0.
 *         out[5, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 1] = 0.
 *         out[5, 2] = 0.
 */
  __pyx_t_93 = 5;
  __pyx_t_94 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_93 * __pyx_v_out.strides[0]) )) + __pyx_t_94)) )) = 0.;

  /* "pylsewave/cynum.pyx":1850
 *         out[4, 5] = 0.
 *         out[5, 0] = 0.
 *         out[5, 1] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 2] = 0.
 *         out[5, 3] = 0.
 */
  __pyx_t_95 = 5;
  __pyx_t_96 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_95 * __pyx_v_out.strides[0]) )) + __pyx_t_96)) )) = 0.;

  /* "pylsewave/cynum.pyx":1851
 *         out[5, 0] = 0.
 *         out[5, 1] = 0.
 *         out[5, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 3] = 0.
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-5/4.)
 */
  __pyx_t_97 = 5;
  __pyx_t_98 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_97 * __pyx_v_out.strides[0]) )) + __pyx_t_98)) )) = 0.;

  /* "pylsewave/cynum.pyx":1852
 *         out[5, 1] = 0.
 *         out[5, 2] = 0.
 *         out[5, 3] = 0.             # <<<<<<<<<<<<<<
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-5/4.)
 *         out[5, 5] = -1./x5
 */
  __pyx_t_99 = 5;
  __pyx_t_100 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_99 * __pyx_v_out.strides[0]) )) + __pyx_t_100)) )) = 0.;

  /* "pylsewave/cynum.pyx":1853
 *         out[5, 2] = 0.
 *         out[5, 3] = 0.
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-5/4.)             # <<<<<<<<<<<<<<
 *         out[5, 5] = -1./x5
 * 
 */
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_101 = 0;
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_102 = 0;
  __pyx_t_103 = 5;
  __pyx_t_104 = 4;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_103 * __pyx_v_out.strides[0]) )) + __pyx_t_104)) )) = ((__pyx_v_x6 / pow(__pyx_v_x5, 2.0)) + ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_rho_) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_101)) )))) * sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_102)) ))), 2.0))))))) * pow(__pyx_v_x5, (-5.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);

  /* "pylsewave/cynum.pyx":1854
 *         out[5, 3] = 0.
 *         out[5, 4] = (x6 / x5**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x5**(-5/4.)
 *         out[5, 5] = -1./x5             # <<<<<<<<<<<<<<
 * 
 *         return STATUS_OK
 */
  __pyx_t_105 = 5;
  __pyx_t_106 = 5;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_105 * __pyx_v_out.strides[0]) )) + __pyx_t_106)) )) = (-1. / __pyx_v_x5);

  /* "pylsewave/cynum.pyx":1856
 *         out[5, 5] = -1./x5
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1807
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int bifurcation_Jr(self, double[::1] x, int[::1] vessel_index_list, double[:, ::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, x5, x6, rho_
 *         cdef int p, d1, d2
 */

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

/* "pylsewave/cynum.pyx":1862
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_R(self, double[::1] x, double[::1] u, double dt, int[::1] vessel_index_list, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef double A_d1, q_d1, A_d2, q_d2
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_5BCsSc_1conjuction_R(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9pylsewave_5cynum_5BCsSc_conjuction_R(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  double __pyx_v_rho_;
  double __pyx_v_A_d1;
  double __pyx_v_q_d1;
  double __pyx_v_A_d2;
  double __pyx_v_q_d2;
  int __pyx_v_d1;
  int __pyx_v_d2;
  Py_ssize_t __pyx_v_last_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_first_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  double __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  double __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  double __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  double __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  int __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;
  __Pyx_memviewslice __pyx_t_29 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_30;
  __Pyx_memviewslice __pyx_t_31 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_32;
  __Pyx_memviewslice __pyx_t_33 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_34;
  __Pyx_memviewslice __pyx_t_35 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  __Pyx_RefNannySetupContext("conjuction_R", 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_conjuction_R); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_5BCsSc_1conjuction_R)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_u, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_vessel_index_list, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_out, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1862, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_12;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":1869
 *         cdef double w1, w2, x_i, W
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]             # <<<<<<<<<<<<<<
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]
 * 
 */
  __pyx_t_13 = 0;
  __pyx_t_14 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_13)) )));
  __pyx_t_15 = 1;
  __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_15)) )));
  __pyx_t_17 = 2;
  __pyx_t_18 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_17)) )));
  __pyx_t_19 = 3;
  __pyx_t_20 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_19)) )));
  __pyx_v_x1 = __pyx_t_14;
  __pyx_v_x2 = __pyx_t_16;
  __pyx_v_x3 = __pyx_t_18;
  __pyx_v_x4 = __pyx_t_20;

  /* "pylsewave/cynum.pyx":1870
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]             # <<<<<<<<<<<<<<
 * 
 *         #this is better to be improved and instead of shape - 1, last index should be shape
 */
  __pyx_t_21 = 0;
  __pyx_t_12 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_21)) )));
  __pyx_t_22 = 1;
  __pyx_t_23 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_22)) )));
  __pyx_v_d1 = __pyx_t_12;
  __pyx_v_d2 = __pyx_t_23;

  /* "pylsewave/cynum.pyx":1873
 * 
 *         #this is better to be improved and instead of shape - 1, last index should be shape
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 *         first_i = 0
 * 
 */
  __pyx_v_last_i = (((__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1874
 *         #this is better to be improved and instead of shape - 1, last index should be shape
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1
 *         first_i = 0             # <<<<<<<<<<<<<<
 * 
 *         A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3]
 */
  __pyx_v_first_i = 0;

  /* "pylsewave/cynum.pyx":1876
 *         first_i = 0
 * 
 *         A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3]             # <<<<<<<<<<<<<<
 *         rho_ = 1.
 * 
 */
  __pyx_t_24 = 0;
  __pyx_t_20 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_24)) )));
  __pyx_t_25 = 1;
  __pyx_t_18 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_25)) )));
  __pyx_t_26 = 2;
  __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_26)) )));
  __pyx_t_27 = 3;
  __pyx_t_14 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u.data) + __pyx_t_27)) )));
  __pyx_v_A_d1 = __pyx_t_20;
  __pyx_v_q_d1 = __pyx_t_18;
  __pyx_v_A_d2 = __pyx_t_16;
  __pyx_v_q_d2 = __pyx_t_14;

  /* "pylsewave/cynum.pyx":1877
 * 
 *         A_d1, q_d1, A_d2, q_d2 = u[0], u[1], u[2], u[3]
 *         rho_ = 1.             # <<<<<<<<<<<<<<
 * 
 *         out[0] = -x2 + x4
 */
  __pyx_v_rho_ = 1.;

  /* "pylsewave/cynum.pyx":1879
 *         rho_ = 1.
 * 
 *         out[0] = -x2 + x4             # <<<<<<<<<<<<<<
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 */
  __pyx_t_28 = 0;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_28)) )) = ((-__pyx_v_x2) + __pyx_v_x4);

  /* "pylsewave/cynum.pyx":1880
 * 
 *         out[0] = -x2 + x4
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x3)))
 */
  __pyx_t_29 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_29, 1);
  __pyx_t_30 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1881
 *         out[0] = -x2 + x4
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +             # <<<<<<<<<<<<<<
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x3)))
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +
 */
  __pyx_t_31 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_31, 1);
  __pyx_t_32 = __pyx_v_last_i;

  /* "pylsewave/cynum.pyx":1882
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(1 -
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x3)))             # <<<<<<<<<<<<<<
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +
 *                   (q_d1/A_d1 + 4*self.pdes.compute_c_i(A_d1, index=last_i-1, vessel_index=d1)))
 */
  __pyx_t_33 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_33, 1);
  __pyx_t_34 = 0;
  __pyx_t_35 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_35, 1);
  __pyx_t_36 = 0;

  /* "pylsewave/cynum.pyx":1880
 * 
 *         out[0] = -x2 + x4
 *         out[1] = (-0.5*rho_*(x2/x1)**2 - self.vessels[d1].f_r0[last_i]*(1 -             # <<<<<<<<<<<<<<
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x3)))
 */
  __pyx_t_37 = 1;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_37)) )) = (((((-0.5 * __pyx_v_rho_) * pow((__pyx_v_x2 / __pyx_v_x1), 2.0)) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_29.data) + __pyx_t_30)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_31.data) + __pyx_t_32)) ))), 2.0)) / __pyx_v_x1))))) + ((0.5 * __pyx_v_rho_) * pow((__pyx_v_x4 / __pyx_v_x3), 2.0))) + ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_33.data) + __pyx_t_34)) ))) * (1.0 - sqrt(((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_35.data) + __pyx_t_36)) ))), 2.0)) / __pyx_v_x3)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_29, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1);

  /* "pylsewave/cynum.pyx":1883
 *                   sqrt(M_PI*self.vessels[d1].r0[last_i]**2 / x1)) + 0.5*rho_*(x4/x3)**2 +
 *                   self.vessels[d2].f_r0[0]*(1 - sqrt(M_PI*self.vessels[d2].r0[0]**2 / x3)))
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +             # <<<<<<<<<<<<<<
 *                   (q_d1/A_d1 + 4*self.pdes.compute_c_i(A_d1, index=last_i-1, vessel_index=d1)))
 *         out[3] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d2) +
 */
  __pyx_t_38 = 2;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_38)) )) = ((((-__pyx_v_x2) / __pyx_v_x1) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_x1, __pyx_v_last_i, __pyx_v_d1, 0))) + ((__pyx_v_q_d1 / __pyx_v_A_d1) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_A_d1, (__pyx_v_last_i - 1), __pyx_v_d1, 0))));

  /* "pylsewave/cynum.pyx":1885
 *         out[2] = (-x2/x1 - 4*self.pdes.compute_c_i(x1, index=last_i, vessel_index=d1) +
 *                   (q_d1/A_d1 + 4*self.pdes.compute_c_i(A_d1, index=last_i-1, vessel_index=d1)))
 *         out[3] = (-x4/x3 + 4*self.pdes.compute_c_i(x3, index=0, vessel_index=d2) +             # <<<<<<<<<<<<<<
 *                   (q_d2/A_d2 - 4*self.pdes.compute_c_i(A_d2, index=1, vessel_index=d2)))
 * 
 */
  __pyx_t_39 = 3;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_39)) )) = ((((-__pyx_v_x4) / __pyx_v_x3) + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_x3, 0, __pyx_v_d2, 0))) + ((__pyx_v_q_d2 / __pyx_v_A_d2) - (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_v_A_d2, 1, __pyx_v_d2, 0))));

  /* "pylsewave/cynum.pyx":1888
 *                   (q_d2/A_d2 - 4*self.pdes.compute_c_i(A_d2, index=1, vessel_index=d2)))
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1862
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_R(self, double[::1] x, double[::1] u, double dt, int[::1] vessel_index_list, double[::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef double A_d1, q_d1, A_d2, q_d2
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __PYX_XDEC_MEMVIEW(&__pyx_t_29, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.BCsSc.conjuction_R", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_5BCsSc_1conjuction_R(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_5BCsSc_1conjuction_R(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_dt;
  __Pyx_memviewslice __pyx_v_vessel_index_list = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("conjuction_R (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_u,&__pyx_n_s_dt,&__pyx_n_s_vessel_index_list,&__pyx_n_s_out,0};
    PyObject* values[5] = {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  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_u)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 1); __PYX_ERR(0, 1862, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 2); __PYX_ERR(0, 1862, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index_list)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 3); __PYX_ERR(0, 1862, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, 4); __PYX_ERR(0, 1862, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conjuction_R") < 0)) __PYX_ERR(0, 1862, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
    }
    __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1862, __pyx_L3_error)
    __pyx_v_u = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 1862, __pyx_L3_error)
    __pyx_v_dt = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1862, __pyx_L3_error)
    __pyx_v_vessel_index_list = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[3]); if (unlikely(!__pyx_v_vessel_index_list.memview)) __PYX_ERR(0, 1862, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[4]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1862, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("conjuction_R", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1862, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.BCsSc.conjuction_R", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5BCsSc_conjuction_R(((struct __pyx_obj_9pylsewave_5cynum_BCsSc *)__pyx_v_self), __pyx_v_x, __pyx_v_u, __pyx_v_dt, __pyx_v_vessel_index_list, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_5BCsSc_conjuction_R(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("conjuction_R", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_9pylsewave_5cynum_5BCsSc_conjuction_R(__pyx_v_self, __pyx_v_x, __pyx_v_u, __pyx_v_dt, __pyx_v_vessel_index_list, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1862, __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("pylsewave.cynum.BCsSc.conjuction_R", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_vessel_index_list, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1894
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_Jr(self, double[::1] x, int[::1] vessel_index_list, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef int d1, d2
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_5BCsSc_3conjuction_Jr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9pylsewave_5cynum_5BCsSc_conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_x3;
  double __pyx_v_x4;
  double __pyx_v_rho_;
  int __pyx_v_d1;
  int __pyx_v_d2;
  Py_ssize_t __pyx_v_last_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  double __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  double __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  double __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  double __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  int __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;
  __Pyx_memviewslice __pyx_t_30 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_31;
  __Pyx_memviewslice __pyx_t_32 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  __Pyx_RefNannySetupContext("conjuction_Jr", 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_conjuction_Jr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_5BCsSc_3conjuction_Jr)) {
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vessel_index_list, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_out, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_10;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":1899
 *         cdef Py_ssize_t last_i, first_i
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]             # <<<<<<<<<<<<<<
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]
 *         rho_ = 1.
 */
  __pyx_t_11 = 0;
  __pyx_t_12 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_11)) )));
  __pyx_t_13 = 1;
  __pyx_t_14 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_13)) )));
  __pyx_t_15 = 2;
  __pyx_t_16 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_15)) )));
  __pyx_t_17 = 3;
  __pyx_t_18 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_17)) )));
  __pyx_v_x1 = __pyx_t_12;
  __pyx_v_x2 = __pyx_t_14;
  __pyx_v_x3 = __pyx_t_16;
  __pyx_v_x4 = __pyx_t_18;

  /* "pylsewave/cynum.pyx":1900
 * 
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]             # <<<<<<<<<<<<<<
 *         rho_ = 1.
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1
 */
  __pyx_t_19 = 0;
  __pyx_t_10 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_19)) )));
  __pyx_t_20 = 1;
  __pyx_t_21 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_vessel_index_list.data) + __pyx_t_20)) )));
  __pyx_v_d1 = __pyx_t_10;
  __pyx_v_d2 = __pyx_t_21;

  /* "pylsewave/cynum.pyx":1901
 *         x1, x2, x3, x4 = x[0], x[1], x[2], x[3]
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]
 *         rho_ = 1.             # <<<<<<<<<<<<<<
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1
 * 
 */
  __pyx_v_rho_ = 1.;

  /* "pylsewave/cynum.pyx":1902
 *         d1, d2 = vessel_index_list[0], vessel_index_list[1]
 *         rho_ = 1.
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1             # <<<<<<<<<<<<<<
 * 
 *         out[0, 0] = 0.
 */
  __pyx_v_last_i = (((__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0.shape[0]) - 1);

  /* "pylsewave/cynum.pyx":1904
 *         last_i = self.vessels[d1].f_r0.shape[0] - 1
 * 
 *         out[0, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 */
  __pyx_t_22 = 0;
  __pyx_t_23 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_22 * __pyx_v_out.strides[0]) )) + __pyx_t_23)) )) = 0.;

  /* "pylsewave/cynum.pyx":1905
 * 
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.             # <<<<<<<<<<<<<<
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 */
  __pyx_t_24 = 0;
  __pyx_t_25 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_24 * __pyx_v_out.strides[0]) )) + __pyx_t_25)) )) = -1.;

  /* "pylsewave/cynum.pyx":1906
 *         out[0, 0] = 0.
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[0, 3] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[d1].f_r0[last_i]*(M_PI*self.vessels[d1].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 */
  __pyx_t_26 = 0;
  __pyx_t_27 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_26 * __pyx_v_out.strides[0]) )) + __pyx_t_27)) )) = 0.;

  /* "pylsewave/cynum.pyx":1907
 *         out[0, 1] = -1.
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.             # <<<<<<<<<<<<<<
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[d1].f_r0[last_i]*(M_PI*self.vessels[d1].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2
 */
  __pyx_t_28 = 0;
  __pyx_t_29 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_28 * __pyx_v_out.strides[0]) )) + __pyx_t_29)) )) = 1.;

  /* "pylsewave/cynum.pyx":1908
 *         out[0, 2] = 0.
 *         out[0, 3] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[d1].f_r0[last_i]*(M_PI*self.vessels[d1].r0[last_i]**2)**0.5 / (2*x1**(3/2.))             # <<<<<<<<<<<<<<
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x3**(3/2.))
 */
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_31 = __pyx_v_last_i;
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_33 = __pyx_v_last_i;
  __pyx_t_34 = 1;
  __pyx_t_35 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_34 * __pyx_v_out.strides[0]) )) + __pyx_t_35)) )) = ((__pyx_v_rho_ * (pow(__pyx_v_x2, 2.0) / pow(__pyx_v_x1, 3.0))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_31)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_33)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x1, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);

  /* "pylsewave/cynum.pyx":1909
 *         out[0, 3] = 1.
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[d1].f_r0[last_i]*(M_PI*self.vessels[d1].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2             # <<<<<<<<<<<<<<
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2
 */
  __pyx_t_36 = 1;
  __pyx_t_37 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_36 * __pyx_v_out.strides[0]) )) + __pyx_t_37)) )) = (((-__pyx_v_rho_) * __pyx_v_x2) / pow(__pyx_v_x1, 2.0));

  /* "pylsewave/cynum.pyx":1910
 *         out[1, 0] = rho_*(x2**2 / x1**3) - self.vessels[d1].f_r0[last_i]*(M_PI*self.vessels[d1].r0[last_i]**2)**0.5 / (2*x1**(3/2.))
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x3**(3/2.))             # <<<<<<<<<<<<<<
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[last_i]*sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-5/4.)
 */
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_38 = 0;
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_39 = 0;
  __pyx_t_40 = 1;
  __pyx_t_41 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_40 * __pyx_v_out.strides[0]) )) + __pyx_t_41)) )) = (((-__pyx_v_rho_) * (pow(__pyx_v_x4, 2.0) / pow(__pyx_v_x3, 3.0))) + (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_38)) ))) * pow((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_39)) ))), 2.0)), 0.5)) / (2.0 * pow(__pyx_v_x3, (3.0 / 2.)))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);

  /* "pylsewave/cynum.pyx":1911
 *         out[1, 1] = -rho_*x2 / x1**2
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2             # <<<<<<<<<<<<<<
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[last_i]*sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-5/4.)
 *         out[2, 1] = -1./x1
 */
  __pyx_t_42 = 1;
  __pyx_t_43 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_42 * __pyx_v_out.strides[0]) )) + __pyx_t_43)) )) = ((__pyx_v_rho_ * __pyx_v_x4) / pow(__pyx_v_x3, 2.0));

  /* "pylsewave/cynum.pyx":1912
 *         out[1, 2] = -rho_*(x4**2 / x3**3) + self.vessels[d2].f_r0[0]*(M_PI*self.vessels[d2].r0[0]**2)**0.5 / (2*x3**(3/2.))
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[last_i]*sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-5/4.)             # <<<<<<<<<<<<<<
 *         out[2, 1] = -1./x1
 *         out[2, 2] = 0.
 */
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_44 = __pyx_v_last_i;
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d1]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_45 = __pyx_v_last_i;
  __pyx_t_46 = 2;
  __pyx_t_47 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_46 * __pyx_v_out.strides[0]) )) + __pyx_t_47)) )) = ((__pyx_v_x2 / pow(__pyx_v_x1, 2.0)) - ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_rho_) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_44)) )))) * sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_45)) ))), 2.0))))))) * pow(__pyx_v_x1, (-5.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);

  /* "pylsewave/cynum.pyx":1913
 *         out[1, 3] = rho_*x4 / x3**2
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[last_i]*sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-5/4.)
 *         out[2, 1] = -1./x1             # <<<<<<<<<<<<<<
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 */
  __pyx_t_48 = 2;
  __pyx_t_49 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_48 * __pyx_v_out.strides[0]) )) + __pyx_t_49)) )) = (-1. / __pyx_v_x1);

  /* "pylsewave/cynum.pyx":1914
 *         out[2, 0] = (x2 / x1**2) - 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d1].f_r0[last_i]*sqrt(M_PI*self.vessels[d1].r0[last_i]**2)))*x1**(-5/4.)
 *         out[2, 1] = -1./x1
 *         out[2, 2] = 0.             # <<<<<<<<<<<<<<
 *         out[2, 3] = 0.
 *         out[3, 0] = 0.
 */
  __pyx_t_50 = 2;
  __pyx_t_51 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_50 * __pyx_v_out.strides[0]) )) + __pyx_t_51)) )) = 0.;

  /* "pylsewave/cynum.pyx":1915
 *         out[2, 1] = -1./x1
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 0] = 0.
 *         out[3, 1] = 0.
 */
  __pyx_t_52 = 2;
  __pyx_t_53 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_52 * __pyx_v_out.strides[0]) )) + __pyx_t_53)) )) = 0.;

  /* "pylsewave/cynum.pyx":1916
 *         out[2, 2] = 0.
 *         out[2, 3] = 0.
 *         out[3, 0] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 1] = 0.
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-5/4.)
 */
  __pyx_t_54 = 3;
  __pyx_t_55 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_54 * __pyx_v_out.strides[0]) )) + __pyx_t_55)) )) = 0.;

  /* "pylsewave/cynum.pyx":1917
 *         out[2, 3] = 0.
 *         out[3, 0] = 0.
 *         out[3, 1] = 0.             # <<<<<<<<<<<<<<
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-5/4.)
 *         out[3, 3] = -1./x3
 */
  __pyx_t_56 = 3;
  __pyx_t_57 = 1;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_56 * __pyx_v_out.strides[0]) )) + __pyx_t_57)) )) = 0.;

  /* "pylsewave/cynum.pyx":1918
 *         out[3, 0] = 0.
 *         out[3, 1] = 0.
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-5/4.)             # <<<<<<<<<<<<<<
 *         out[3, 3] = -1./x3
 * 
 */
  __pyx_t_32 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).f_r0;
  __PYX_INC_MEMVIEW(&__pyx_t_32, 1);
  __pyx_t_58 = 0;
  __pyx_t_30 = (__pyx_v_self->__pyx_base.vessels[__pyx_v_d2]).r0;
  __PYX_INC_MEMVIEW(&__pyx_t_30, 1);
  __pyx_t_59 = 0;
  __pyx_t_60 = 3;
  __pyx_t_61 = 2;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_60 * __pyx_v_out.strides[0]) )) + __pyx_t_61)) )) = ((__pyx_v_x4 / pow(__pyx_v_x3, 2.0)) + ((4.0 * ((1.0 / 4.) * sqrt((((0.5 / __pyx_v_rho_) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_32.data) + __pyx_t_58)) )))) * sqrt((M_PI * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_30.data) + __pyx_t_59)) ))), 2.0))))))) * pow(__pyx_v_x3, (-5.0 / 4.))));
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);

  /* "pylsewave/cynum.pyx":1919
 *         out[3, 1] = 0.
 *         out[3, 2] = (x4 / x3**2) + 4*(1/4.*sqrt((0.5/rho_)*self.vessels[d2].f_r0[0]*sqrt(M_PI*self.vessels[d2].r0[0]**2)))*x3**(-5/4.)
 *         out[3, 3] = -1./x3             # <<<<<<<<<<<<<<
 * 
 *         return STATUS_OK
 */
  __pyx_t_62 = 3;
  __pyx_t_63 = 3;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_62 * __pyx_v_out.strides[0]) )) + __pyx_t_63)) )) = (-1. / __pyx_v_x3);

  /* "pylsewave/cynum.pyx":1921
 *         out[3, 3] = -1./x3
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1894
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cpdef int conjuction_Jr(self, double[::1] x, int[::1] vessel_index_list, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         cdef double x1, x2, x3, x4, rho_
 *         cdef int d1, d2
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.BCsSc.conjuction_Jr", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_5BCsSc_3conjuction_Jr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_5BCsSc_3conjuction_Jr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_vessel_index_list = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("conjuction_Jr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_vessel_index_list,&__pyx_n_s_out,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_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index_list)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_Jr", 1, 3, 3, 1); __PYX_ERR(0, 1894, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("conjuction_Jr", 1, 3, 3, 2); __PYX_ERR(0, 1894, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conjuction_Jr") < 0)) __PYX_ERR(0, 1894, __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_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1894, __pyx_L3_error)
    __pyx_v_vessel_index_list = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[1]); if (unlikely(!__pyx_v_vessel_index_list.memview)) __PYX_ERR(0, 1894, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[2]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1894, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("conjuction_Jr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1894, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.BCsSc.conjuction_Jr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_5BCsSc_2conjuction_Jr(((struct __pyx_obj_9pylsewave_5cynum_BCsSc *)__pyx_v_self), __pyx_v_x, __pyx_v_vessel_index_list, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_5BCsSc_2conjuction_Jr(struct __pyx_obj_9pylsewave_5cynum_BCsSc *__pyx_v_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_vessel_index_list, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("conjuction_Jr", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_9pylsewave_5cynum_5BCsSc_conjuction_Jr(__pyx_v_self, __pyx_v_x, __pyx_v_vessel_index_list, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __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("pylsewave.cynum.BCsSc.conjuction_Jr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_vessel_index_list, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1925
 * 
 * cdef class BCsD(cBCs):
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         _A, _q = u
 *         theta = dt / dx
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_4BCsD_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_4BCsD_U_0(struct __pyx_obj_9pylsewave_5cynum_BCsD *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  PyObject *__pyx_v__A = NULL;
  PyObject *__pyx_v__q = NULL;
  CYTHON_UNUSED double __pyx_v_theta;
  CYTHON_UNUSED double __pyx_v_dt2;
  PyObject *__pyx_v_p_pres = NULL;
  PyObject *__pyx_v_A0 = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_A = NULL;
  PyObject *__pyx_v_W2_0 = NULL;
  PyObject *__pyx_v_W2_1 = NULL;
  PyObject *__pyx_v_l2 = NULL;
  double __pyx_v_x;
  double __pyx_v_W2;
  PyObject *__pyx_v_q = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  double __pyx_t_14;
  double __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  __Pyx_RefNannySetupContext("U_0", 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_U_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_4BCsD_1U_0)) {
      if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 1925, __pyx_L1_error) }
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1925, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1925, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1925, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1925, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1925, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 1925, __pyx_L1_error) }
      __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_out, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1925, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_9 = __pyx_t_1; __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_12 = PyTuple_New(6+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1925, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_11, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_11, __pyx_t_8);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1925, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":1926
 * cdef class BCsD(cBCs):
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u             # <<<<<<<<<<<<<<
 *         theta = dt / dx
 *         dt2 = dt / 2.
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #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_ERR(0, 1926, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_9);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_9 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_9)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1926, __pyx_L1_error)
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1926, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v__A = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v__q = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "pylsewave/cynum.pyx":1927
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u
 *         theta = dt / dx             # <<<<<<<<<<<<<<
 *         dt2 = dt / 2.
 *         p_pres = self.inlet_fun(t)
 */
  if (unlikely(__pyx_v_dx == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1927, __pyx_L1_error)
  }
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":1928
 *         _A, _q = u
 *         theta = dt / dx
 *         dt2 = dt / 2.             # <<<<<<<<<<<<<<
 *         p_pres = self.inlet_fun(t)
 * 
 */
  __pyx_v_dt2 = (__pyx_v_dt / 2.);

  /* "pylsewave/cynum.pyx":1929
 *         theta = dt / dx
 *         dt2 = dt / 2.
 *         p_pres = self.inlet_fun(t)             # <<<<<<<<<<<<<<
 * 
 *         A0 = np.pi*self.mesh.vessels[vessel_index].r0[0]**2.0
 */
  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.inlet_fun);
  __pyx_t_2 = __pyx_v_self->__pyx_base.inlet_fun; __pyx_t_12 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_12) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1929, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); __pyx_t_12 = NULL;
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_p_pres = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":1931
 *         p_pres = self.inlet_fun(t)
 * 
 *         A0 = np.pi*self.mesh.vessels[vessel_index].r0[0]**2.0             # <<<<<<<<<<<<<<
 *         f = self.mesh.vessels[vessel_index].f_r0[0]
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_vessel_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_r0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Power(__pyx_t_8, __pyx_float_2_0, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_A0 = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":1932
 * 
 *         A0 = np.pi*self.mesh.vessels[vessel_index].r0[0]**2.0
 *         f = self.mesh.vessels[vessel_index].f_r0[0]             # <<<<<<<<<<<<<<
 * 
 *         A = A0 / (1 - (p_pres /f))**2.0
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_vessel_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_f_r0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":1934
 *         f = self.mesh.vessels[vessel_index].f_r0[0]
 * 
 *         A = A0 / (1 - (p_pres /f))**2.0             # <<<<<<<<<<<<<<
 *         # A = ((p_pres/(f*np.sqrt(A0))) + np.sqrt(A0))**2
 *         W2_0 = _q[0]/_A[0] - 4*self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index)
 */
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_p_pres, __pyx_v_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Power(__pyx_t_8, __pyx_float_2_0, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_A0, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_A = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":1936
 *         A = A0 / (1 - (p_pres /f))**2.0
 *         # A = ((p_pres/(f*np.sqrt(A0))) + np.sqrt(A0))**2
 *         W2_0 = _q[0]/_A[0] - 4*self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index)             # <<<<<<<<<<<<<<
 *         W2_1 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)
 *         l2 = _q[0]/_A[0] - self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index)
 */
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v__q, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v__A, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_A); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1936, __pyx_L1_error)
  __pyx_t_1 = PyFloat_FromDouble((4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_t_14, 0, __pyx_v_vessel_index, 0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_W2_0 = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":1937
 *         # A = ((p_pres/(f*np.sqrt(A0))) + np.sqrt(A0))**2
 *         W2_0 = _q[0]/_A[0] - 4*self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index)
 *         W2_1 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)             # <<<<<<<<<<<<<<
 *         l2 = _q[0]/_A[0] - self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index)
 *         x = fabs(-l2*dt)
 */
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v__q, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v__A, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v__A, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble((4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_t_14, 1, __pyx_v_vessel_index, 0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_W2_1 = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":1938
 *         W2_0 = _q[0]/_A[0] - 4*self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index)
 *         W2_1 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)
 *         l2 = _q[0]/_A[0] - self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index)             # <<<<<<<<<<<<<<
 *         x = fabs(-l2*dt)
 *         # W2 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)
 */
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v__q, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v__A, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_A); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1938, __pyx_L1_error)
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_t_14, 0, __pyx_v_vessel_index, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_l2 = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":1939
 *         W2_1 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)
 *         l2 = _q[0]/_A[0] - self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index)
 *         x = fabs(-l2*dt)             # <<<<<<<<<<<<<<
 *         # W2 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)
 *         W2 = linear_extrapolation(x, 0.0, dx, W2_0, W2_1)
 */
  __pyx_t_8 = PyNumber_Negative(__pyx_v_l2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1939, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_x = fabs(__pyx_t_14);

  /* "pylsewave/cynum.pyx":1941
 *         x = fabs(-l2*dt)
 *         # W2 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)
 *         W2 = linear_extrapolation(x, 0.0, dx, W2_0, W2_1)             # <<<<<<<<<<<<<<
 *         # W2 = W2_0 - l2*(dt/dx)*(W2_1 - W2_0)
 *         # W1 =
 */
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_W2_0); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1941, __pyx_L1_error)
  __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_W2_1); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1941, __pyx_L1_error)
  __pyx_v_W2 = __pyx_f_9pylsewave_5cynum_linear_extrapolation(__pyx_v_x, 0.0, __pyx_v_dx, __pyx_t_14, __pyx_t_15, 0);

  /* "pylsewave/cynum.pyx":1944
 *         # W2 = W2_0 - l2*(dt/dx)*(W2_1 - W2_0)
 *         # W1 =
 *         q = A*(W2 + 4*self.pdes.compute_c_i(A, index=0, vessel_index=vessel_index))             # <<<<<<<<<<<<<<
 *         # q = A*(W2 + 4*A*np.sqrt((f*np.sqrt(A0))/(2*self._rho)))
 * 
 */
  __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_A); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1944, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_W2 + (4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.pdes, __pyx_t_15, 0, __pyx_v_vessel_index, 0)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_A, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_q = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":1947
 *         # q = A*(W2 + 4*A*np.sqrt((f*np.sqrt(A0))/(2*self._rho)))
 * 
 *         out[0, 0] = A             # <<<<<<<<<<<<<<
 *         out[1, 0] = q
 * 
 */
  __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_A); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1947, __pyx_L1_error)
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = -1;
  if (__pyx_t_16 < 0) {
    __pyx_t_16 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_16 < 0)) __pyx_t_18 = 0;
  } else if (unlikely(__pyx_t_16 >= __pyx_v_out.shape[0])) __pyx_t_18 = 0;
  if (__pyx_t_17 < 0) {
    __pyx_t_17 += __pyx_v_out.shape[1];
    if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 1;
  } else if (unlikely(__pyx_t_17 >= __pyx_v_out.shape[1])) __pyx_t_18 = 1;
  if (unlikely(__pyx_t_18 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_18);
    __PYX_ERR(0, 1947, __pyx_L1_error)
  }
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) )) + __pyx_t_17)) )) = __pyx_t_15;

  /* "pylsewave/cynum.pyx":1948
 * 
 *         out[0, 0] = A
 *         out[1, 0] = q             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_q); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L1_error)
  __pyx_t_19 = 1;
  __pyx_t_20 = 0;
  __pyx_t_18 = -1;
  if (__pyx_t_19 < 0) {
    __pyx_t_19 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_18 = 0;
  } else if (unlikely(__pyx_t_19 >= __pyx_v_out.shape[0])) __pyx_t_18 = 0;
  if (__pyx_t_20 < 0) {
    __pyx_t_20 += __pyx_v_out.shape[1];
    if (unlikely(__pyx_t_20 < 0)) __pyx_t_18 = 1;
  } else if (unlikely(__pyx_t_20 >= __pyx_v_out.shape[1])) __pyx_t_18 = 1;
  if (unlikely(__pyx_t_18 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_18);
    __PYX_ERR(0, 1948, __pyx_L1_error)
  }
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) )) + __pyx_t_20)) )) = __pyx_t_15;

  /* "pylsewave/cynum.pyx":1925
 * 
 * cdef class BCsD(cBCs):
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         _A, _q = u
 *         theta = dt / dx
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_WriteUnraisable("pylsewave.cynum.BCsD.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__A);
  __Pyx_XDECREF(__pyx_v__q);
  __Pyx_XDECREF(__pyx_v_p_pres);
  __Pyx_XDECREF(__pyx_v_A0);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_A);
  __Pyx_XDECREF(__pyx_v_W2_0);
  __Pyx_XDECREF(__pyx_v_W2_1);
  __Pyx_XDECREF(__pyx_v_l2);
  __Pyx_XDECREF(__pyx_v_q);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_4BCsD_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_4BCsD_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_t;
  double __pyx_v_dx;
  double __pyx_v_dt;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("U_0 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_t,&__pyx_n_s_dx,&__pyx_n_s_dt,&__pyx_n_s_vessel_index,&__pyx_n_s_out,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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 1); __PYX_ERR(0, 1925, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 2); __PYX_ERR(0, 1925, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 3); __PYX_ERR(0, 1925, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 4); __PYX_ERR(0, 1925, __pyx_L3_error)
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 5); __PYX_ERR(0, 1925, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "U_0") < 0)) __PYX_ERR(0, 1925, __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_u = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 1925, __pyx_L3_error)
    __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1925, __pyx_L3_error)
    __pyx_v_dx = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1925, __pyx_L3_error)
    __pyx_v_dt = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1925, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1925, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[5]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1925, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1925, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.BCsD.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_4BCsD_U_0(((struct __pyx_obj_9pylsewave_5cynum_BCsD *)__pyx_v_self), __pyx_v_u, __pyx_v_t, __pyx_v_dx, __pyx_v_dt, __pyx_v_vessel_index, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_4BCsD_U_0(struct __pyx_obj_9pylsewave_5cynum_BCsD *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("U_0", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 1925, __pyx_L1_error) }
  if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 1925, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_4BCsD_U_0(__pyx_v_self, __pyx_v_u, __pyx_v_t, __pyx_v_dx, __pyx_v_dt, __pyx_v_vessel_index, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1925, __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("pylsewave.cynum.BCsD.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1953
 * cdef class BCsADAN56(cBCsWat):
 * 
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         cdef double theta, dt2, q_1, A, q_pres
 * 
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_9BCsADAN56_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_9BCsADAN56_U_0(struct __pyx_obj_9pylsewave_5cynum_BCsADAN56 *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, CYTHON_UNUSED int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  double __pyx_v_theta;
  CYTHON_UNUSED double __pyx_v_dt2;
  double __pyx_v_q_1;
  double __pyx_v_A;
  double __pyx_v_q_pres;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  double __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;
  __Pyx_RefNannySetupContext("U_0", 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_U_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_9BCsADAN56_1U_0)) {
      if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 1953, __pyx_L1_error) }
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 1953, __pyx_L1_error) }
      __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_out, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_9 = __pyx_t_1; __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_12 = PyTuple_New(6+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_11, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_11, __pyx_t_8);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":1956
 *         cdef double theta, dt2, q_1, A, q_pres
 * 
 *         theta = dt/dx             # <<<<<<<<<<<<<<
 *         dt2 = 0.5*dt
 * 
 */
  if (unlikely(__pyx_v_dx == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1956, __pyx_L1_error)
  }
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":1957
 * 
 *         theta = dt/dx
 *         dt2 = 0.5*dt             # <<<<<<<<<<<<<<
 * 
 *         q_pres = self.inlet_fun(t)
 */
  __pyx_v_dt2 = (0.5 * __pyx_v_dt);

  /* "pylsewave/cynum.pyx":1959
 *         dt2 = 0.5*dt
 * 
 *         q_pres = self.inlet_fun(t)             # <<<<<<<<<<<<<<
 * 
 *         q_1 = out[1, 1]
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.inlet_fun);
  __pyx_t_9 = __pyx_v_self->__pyx_base.__pyx_base.inlet_fun; __pyx_t_12 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (!__pyx_t_12) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); __pyx_t_12 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1959, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_q_pres = __pyx_t_13;

  /* "pylsewave/cynum.pyx":1961
 *         q_pres = self.inlet_fun(t)
 * 
 *         q_1 = out[1, 1]             # <<<<<<<<<<<<<<
 * 
 *         # A[n+1, 0]
 */
  __pyx_t_14 = 1;
  __pyx_t_15 = 1;
  __pyx_t_16 = -1;
  if (__pyx_t_14 < 0) {
    __pyx_t_14 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_14 < 0)) __pyx_t_16 = 0;
  } else if (unlikely(__pyx_t_14 >= __pyx_v_out.shape[0])) __pyx_t_16 = 0;
  if (__pyx_t_15 < 0) {
    __pyx_t_15 += __pyx_v_out.shape[1];
    if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
  } else if (unlikely(__pyx_t_15 >= __pyx_v_out.shape[1])) __pyx_t_16 = 1;
  if (unlikely(__pyx_t_16 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_16);
    __PYX_ERR(0, 1961, __pyx_L1_error)
  }
  __pyx_v_q_1 = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_14 * __pyx_v_out.strides[0]) )) + __pyx_t_15)) )));

  /* "pylsewave/cynum.pyx":1964
 * 
 *         # A[n+1, 0]
 *         A = u[0, 0] - (2.*theta)*(q_1 - q_pres)             # <<<<<<<<<<<<<<
 * 
 *         out[0, 0] = A
 */
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  __pyx_t_16 = -1;
  if (__pyx_t_17 < 0) {
    __pyx_t_17 += __pyx_v_u.shape[0];
    if (unlikely(__pyx_t_17 < 0)) __pyx_t_16 = 0;
  } else if (unlikely(__pyx_t_17 >= __pyx_v_u.shape[0])) __pyx_t_16 = 0;
  if (__pyx_t_18 < 0) {
    __pyx_t_18 += __pyx_v_u.shape[1];
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_16 = 1;
  } else if (unlikely(__pyx_t_18 >= __pyx_v_u.shape[1])) __pyx_t_16 = 1;
  if (unlikely(__pyx_t_16 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_16);
    __PYX_ERR(0, 1964, __pyx_L1_error)
  }
  __pyx_v_A = ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_17 * __pyx_v_u.strides[0]) )) + __pyx_t_18)) ))) - ((2. * __pyx_v_theta) * (__pyx_v_q_1 - __pyx_v_q_pres)));

  /* "pylsewave/cynum.pyx":1966
 *         A = u[0, 0] - (2.*theta)*(q_1 - q_pres)
 * 
 *         out[0, 0] = A             # <<<<<<<<<<<<<<
 *         out[1, 0] = q_pres
 * 
 */
  __pyx_t_19 = 0;
  __pyx_t_20 = 0;
  __pyx_t_16 = -1;
  if (__pyx_t_19 < 0) {
    __pyx_t_19 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_16 = 0;
  } else if (unlikely(__pyx_t_19 >= __pyx_v_out.shape[0])) __pyx_t_16 = 0;
  if (__pyx_t_20 < 0) {
    __pyx_t_20 += __pyx_v_out.shape[1];
    if (unlikely(__pyx_t_20 < 0)) __pyx_t_16 = 1;
  } else if (unlikely(__pyx_t_20 >= __pyx_v_out.shape[1])) __pyx_t_16 = 1;
  if (unlikely(__pyx_t_16 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_16);
    __PYX_ERR(0, 1966, __pyx_L1_error)
  }
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_19 * __pyx_v_out.strides[0]) )) + __pyx_t_20)) )) = __pyx_v_A;

  /* "pylsewave/cynum.pyx":1967
 * 
 *         out[0, 0] = A
 *         out[1, 0] = q_pres             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __pyx_t_21 = 1;
  __pyx_t_22 = 0;
  __pyx_t_16 = -1;
  if (__pyx_t_21 < 0) {
    __pyx_t_21 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_21 < 0)) __pyx_t_16 = 0;
  } else if (unlikely(__pyx_t_21 >= __pyx_v_out.shape[0])) __pyx_t_16 = 0;
  if (__pyx_t_22 < 0) {
    __pyx_t_22 += __pyx_v_out.shape[1];
    if (unlikely(__pyx_t_22 < 0)) __pyx_t_16 = 1;
  } else if (unlikely(__pyx_t_22 >= __pyx_v_out.shape[1])) __pyx_t_16 = 1;
  if (unlikely(__pyx_t_16 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_16);
    __PYX_ERR(0, 1967, __pyx_L1_error)
  }
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_21 * __pyx_v_out.strides[0]) )) + __pyx_t_22)) )) = __pyx_v_q_pres;

  /* "pylsewave/cynum.pyx":1953
 * cdef class BCsADAN56(cBCsWat):
 * 
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         cdef double theta, dt2, q_1, A, q_pres
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_WriteUnraisable("pylsewave.cynum.BCsADAN56.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_9BCsADAN56_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_9BCsADAN56_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_t;
  double __pyx_v_dx;
  double __pyx_v_dt;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("U_0 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_t,&__pyx_n_s_dx,&__pyx_n_s_dt,&__pyx_n_s_vessel_index,&__pyx_n_s_out,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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 1); __PYX_ERR(0, 1953, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 2); __PYX_ERR(0, 1953, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 3); __PYX_ERR(0, 1953, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 4); __PYX_ERR(0, 1953, __pyx_L3_error)
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 5); __PYX_ERR(0, 1953, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "U_0") < 0)) __PYX_ERR(0, 1953, __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_u = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 1953, __pyx_L3_error)
    __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1953, __pyx_L3_error)
    __pyx_v_dx = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1953, __pyx_L3_error)
    __pyx_v_dt = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1953, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1953, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[5]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 1953, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1953, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.BCsADAN56.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_9BCsADAN56_U_0(((struct __pyx_obj_9pylsewave_5cynum_BCsADAN56 *)__pyx_v_self), __pyx_v_u, __pyx_v_t, __pyx_v_dx, __pyx_v_dt, __pyx_v_vessel_index, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_9BCsADAN56_U_0(struct __pyx_obj_9pylsewave_5cynum_BCsADAN56 *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("U_0", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 1953, __pyx_L1_error) }
  if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 1953, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_9BCsADAN56_U_0(__pyx_v_self, __pyx_v_u, __pyx_v_t, __pyx_v_dx, __pyx_v_dt, __pyx_v_vessel_index, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1953, __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("pylsewave.cynum.BCsADAN56.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":1973
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int U_L(self, double[:, ::1] u, double t, double dx, double dt,             # <<<<<<<<<<<<<<
 *                   int vessel_index, double[:, ::1] out) nogil except *:
 *         cdef double theta, dt2, out_a, out_q, p0, p_out, x
 */

static int __pyx_f_9pylsewave_5cynum_9BCsADAN56_U_L(struct __pyx_obj_9pylsewave_5cynum_BCsADAN56 *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out) {
  double __pyx_v_theta;
  CYTHON_UNUSED double __pyx_v_dt2;
  double __pyx_v_out_a;
  double __pyx_v_out_q;
  double __pyx_v_p0;
  double __pyx_v_p_out;
  double __pyx_v_x;
  CYTHON_UNUSED size_t __pyx_v_rws;
  size_t __pyx_v_clms;
  double __pyx_v_q_m1;
  int __pyx_v_k;
  double __pyx_v_R1;
  double __pyx_v_Rt;
  double __pyx_v_Ct;
  double __pyx_v_p_old;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  size_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  size_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  size_t __pyx_t_6;
  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  size_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  size_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  size_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  size_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  size_t __pyx_t_21;

  /* "pylsewave/cynum.pyx":1978
 *         cdef size_t rws, clms, i, j
 *         cdef double q_m1
 *         rws = u.shape[0]             # <<<<<<<<<<<<<<
 *         clms = u.shape[1]
 *         theta = dt/dx
 */
  __pyx_v_rws = (__pyx_v_u.shape[0]);

  /* "pylsewave/cynum.pyx":1979
 *         cdef double q_m1
 *         rws = u.shape[0]
 *         clms = u.shape[1]             # <<<<<<<<<<<<<<
 *         theta = dt/dx
 *         dt2 = dt/2.
 */
  __pyx_v_clms = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":1980
 *         rws = u.shape[0]
 *         clms = u.shape[1]
 *         theta = dt/dx             # <<<<<<<<<<<<<<
 *         dt2 = dt/2.
 *         q_m1 = out[1, clms-2]
 */
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":1981
 *         clms = u.shape[1]
 *         theta = dt/dx
 *         dt2 = dt/2.             # <<<<<<<<<<<<<<
 *         q_m1 = out[1, clms-2]
 * 
 */
  __pyx_v_dt2 = (__pyx_v_dt / 2.);

  /* "pylsewave/cynum.pyx":1982
 *         theta = dt/dx
 *         dt2 = dt/2.
 *         q_m1 = out[1, clms-2]             # <<<<<<<<<<<<<<
 * 
 *         p_out = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)
 */
  __pyx_t_1 = 1;
  __pyx_t_2 = (__pyx_v_clms - 2);
  __pyx_v_q_m1 = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_1 * __pyx_v_out.strides[0]) )) + __pyx_t_2)) )));

  /* "pylsewave/cynum.pyx":1984
 *         q_m1 = out[1, clms-2]
 * 
 *         p_out = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)             # <<<<<<<<<<<<<<
 *         p0 = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)
 * 
 */
  __pyx_t_3 = 0;
  __pyx_t_4 = (__pyx_v_clms - 1);
  __pyx_v_p_out = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.__pyx_base.pdes->__pyx_vtab)->pressure_i(__pyx_v_self->__pyx_base.__pyx_base.pdes, (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_3 * __pyx_v_u.strides[0]) )) + __pyx_t_4)) ))), (__pyx_v_clms - 1), __pyx_v_vessel_index);

  /* "pylsewave/cynum.pyx":1985
 * 
 *         p_out = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)
 *         p0 = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)             # <<<<<<<<<<<<<<
 * 
 *         cdef int k = 0
 */
  __pyx_t_5 = 0;
  __pyx_t_6 = (__pyx_v_clms - 1);
  __pyx_v_p0 = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.__pyx_base.pdes->__pyx_vtab)->pressure_i(__pyx_v_self->__pyx_base.__pyx_base.pdes, (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_5 * __pyx_v_u.strides[0]) )) + __pyx_t_6)) ))), (__pyx_v_clms - 1), __pyx_v_vessel_index);

  /* "pylsewave/cynum.pyx":1987
 *         p0 = self.pdes.pressure_i(u[0, clms-1], clms-1, vessel_index)
 * 
 *         cdef int k = 0             # <<<<<<<<<<<<<<
 *         cdef double R1, Rt, Ct, p_old
 * 
 */
  __pyx_v_k = 0;

  /* "pylsewave/cynum.pyx":1990
 *         cdef double R1, Rt, Ct, p_old
 * 
 *         R1 = self.vessels[vessel_index].RLC[0]             # <<<<<<<<<<<<<<
 *         Rt = self.vessels[vessel_index].RLC[1]
 *         Ct = self.vessels[vessel_index].RLC[2]
 */
  __pyx_t_7 = (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_vessel_index]).RLC;
  __PYX_INC_MEMVIEW(&__pyx_t_7, 0);
  __pyx_t_8 = 0;
  __pyx_v_R1 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_7.data) + __pyx_t_8)) )));
  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 0);

  /* "pylsewave/cynum.pyx":1991
 * 
 *         R1 = self.vessels[vessel_index].RLC[0]
 *         Rt = self.vessels[vessel_index].RLC[1]             # <<<<<<<<<<<<<<
 *         Ct = self.vessels[vessel_index].RLC[2]
 * 
 */
  __pyx_t_7 = (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_vessel_index]).RLC;
  __PYX_INC_MEMVIEW(&__pyx_t_7, 0);
  __pyx_t_9 = 1;
  __pyx_v_Rt = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_7.data) + __pyx_t_9)) )));
  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 0);

  /* "pylsewave/cynum.pyx":1992
 *         R1 = self.vessels[vessel_index].RLC[0]
 *         Rt = self.vessels[vessel_index].RLC[1]
 *         Ct = self.vessels[vessel_index].RLC[2]             # <<<<<<<<<<<<<<
 * 
 *         x = (dt / (R1*Rt*Ct))
 */
  __pyx_t_7 = (__pyx_v_self->__pyx_base.__pyx_base.vessels[__pyx_v_vessel_index]).RLC;
  __PYX_INC_MEMVIEW(&__pyx_t_7, 0);
  __pyx_t_10 = 2;
  __pyx_v_Ct = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_7.data) + __pyx_t_10)) )));
  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 0);

  /* "pylsewave/cynum.pyx":1994
 *         Ct = self.vessels[vessel_index].RLC[2]
 * 
 *         x = (dt / (R1*Rt*Ct))             # <<<<<<<<<<<<<<
 *         while k < 1000:
 *             p_old = p0
 */
  __pyx_v_x = (__pyx_v_dt / ((__pyx_v_R1 * __pyx_v_Rt) * __pyx_v_Ct));

  /* "pylsewave/cynum.pyx":1995
 * 
 *         x = (dt / (R1*Rt*Ct))
 *         while k < 1000:             # <<<<<<<<<<<<<<
 *             p_old = p0
 *             out_q = (x*p_out - x*(R1 + Rt)*u[1, clms-1] +
 */
  while (1) {
    __pyx_t_11 = ((__pyx_v_k < 0x3E8) != 0);
    if (!__pyx_t_11) break;

    /* "pylsewave/cynum.pyx":1996
 *         x = (dt / (R1*Rt*Ct))
 *         while k < 1000:
 *             p_old = p0             # <<<<<<<<<<<<<<
 *             out_q = (x*p_out - x*(R1 + Rt)*u[1, clms-1] +
 *                      (p0 - p_out)/R1 + u[1, clms-1])
 */
    __pyx_v_p_old = __pyx_v_p0;

    /* "pylsewave/cynum.pyx":1997
 *         while k < 1000:
 *             p_old = p0
 *             out_q = (x*p_out - x*(R1 + Rt)*u[1, clms-1] +             # <<<<<<<<<<<<<<
 *                      (p0 - p_out)/R1 + u[1, clms-1])
 * 
 */
    __pyx_t_12 = 1;
    __pyx_t_13 = (__pyx_v_clms - 1);

    /* "pylsewave/cynum.pyx":1998
 *             p_old = p0
 *             out_q = (x*p_out - x*(R1 + Rt)*u[1, clms-1] +
 *                      (p0 - p_out)/R1 + u[1, clms-1])             # <<<<<<<<<<<<<<
 * 
 *             out_a = u[0, clms-1] - theta*(out_q - q_m1)
 */
    __pyx_t_14 = 1;
    __pyx_t_15 = (__pyx_v_clms - 1);
    __pyx_v_out_q = ((((__pyx_v_x * __pyx_v_p_out) - ((__pyx_v_x * (__pyx_v_R1 + __pyx_v_Rt)) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_12 * __pyx_v_u.strides[0]) )) + __pyx_t_13)) ))))) + ((__pyx_v_p0 - __pyx_v_p_out) / __pyx_v_R1)) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_14 * __pyx_v_u.strides[0]) )) + __pyx_t_15)) ))));

    /* "pylsewave/cynum.pyx":2000
 *                      (p0 - p_out)/R1 + u[1, clms-1])
 * 
 *             out_a = u[0, clms-1] - theta*(out_q - q_m1)             # <<<<<<<<<<<<<<
 *             p0 = self.pdes.pressure_i(out_a, index=clms-1, vessel_index=vessel_index)
 *             if fabs(p_old - p0) < 1e-7:
 */
    __pyx_t_16 = 0;
    __pyx_t_17 = (__pyx_v_clms - 1);
    __pyx_v_out_a = ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_16 * __pyx_v_u.strides[0]) )) + __pyx_t_17)) ))) - (__pyx_v_theta * (__pyx_v_out_q - __pyx_v_q_m1)));

    /* "pylsewave/cynum.pyx":2001
 * 
 *             out_a = u[0, clms-1] - theta*(out_q - q_m1)
 *             p0 = self.pdes.pressure_i(out_a, index=clms-1, vessel_index=vessel_index)             # <<<<<<<<<<<<<<
 *             if fabs(p_old - p0) < 1e-7:
 *                 break
 */
    __pyx_v_p0 = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.__pyx_base.pdes->__pyx_vtab)->pressure_i(__pyx_v_self->__pyx_base.__pyx_base.pdes, __pyx_v_out_a, (__pyx_v_clms - 1), __pyx_v_vessel_index);

    /* "pylsewave/cynum.pyx":2002
 *             out_a = u[0, clms-1] - theta*(out_q - q_m1)
 *             p0 = self.pdes.pressure_i(out_a, index=clms-1, vessel_index=vessel_index)
 *             if fabs(p_old - p0) < 1e-7:             # <<<<<<<<<<<<<<
 *                 break
 *             k += 1
 */
    __pyx_t_11 = ((fabs((__pyx_v_p_old - __pyx_v_p0)) < 1e-7) != 0);
    if (__pyx_t_11) {

      /* "pylsewave/cynum.pyx":2003
 *             p0 = self.pdes.pressure_i(out_a, index=clms-1, vessel_index=vessel_index)
 *             if fabs(p_old - p0) < 1e-7:
 *                 break             # <<<<<<<<<<<<<<
 *             k += 1
 * #        printf("%d\n", k)
 */
      goto __pyx_L4_break;

      /* "pylsewave/cynum.pyx":2002
 *             out_a = u[0, clms-1] - theta*(out_q - q_m1)
 *             p0 = self.pdes.pressure_i(out_a, index=clms-1, vessel_index=vessel_index)
 *             if fabs(p_old - p0) < 1e-7:             # <<<<<<<<<<<<<<
 *                 break
 *             k += 1
 */
    }

    /* "pylsewave/cynum.pyx":2004
 *             if fabs(p_old - p0) < 1e-7:
 *                 break
 *             k += 1             # <<<<<<<<<<<<<<
 * #        printf("%d\n", k)
 *         out[0, clms-1] = out_a
 */
    __pyx_v_k = (__pyx_v_k + 1);
  }
  __pyx_L4_break:;

  /* "pylsewave/cynum.pyx":2006
 *             k += 1
 * #        printf("%d\n", k)
 *         out[0, clms-1] = out_a             # <<<<<<<<<<<<<<
 *         out[1, clms-1] = out_q
 * 
 */
  __pyx_t_18 = 0;
  __pyx_t_19 = (__pyx_v_clms - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_18 * __pyx_v_out.strides[0]) )) + __pyx_t_19)) )) = __pyx_v_out_a;

  /* "pylsewave/cynum.pyx":2007
 * #        printf("%d\n", k)
 *         out[0, clms-1] = out_a
 *         out[1, clms-1] = out_q             # <<<<<<<<<<<<<<
 * 
 *         return STATUS_OK
 */
  __pyx_t_20 = 1;
  __pyx_t_21 = (__pyx_v_clms - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_20 * __pyx_v_out.strides[0]) )) + __pyx_t_21)) )) = __pyx_v_out_q;

  /* "pylsewave/cynum.pyx":2009
 *         out[1, clms-1] = out_q
 * 
 *         return STATUS_OK             # <<<<<<<<<<<<<<
 * 
 * cdef class cBCsHandModelNonReflBcs(cBCsWat):
 */
  __pyx_r = __pyx_v_9pylsewave_5cynum_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":1973
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef int U_L(self, double[:, ::1] u, double t, double dx, double dt,             # <<<<<<<<<<<<<<
 *                   int vessel_index, double[:, ::1] out) nogil except *:
 *         cdef double theta, dt2, out_a, out_q, p0, p_out, x
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2012
 * 
 * cdef class cBCsHandModelNonReflBcs(cBCsWat):
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         _A, _q = u
 *         theta = dt / dx
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_U_0(struct __pyx_obj_9pylsewave_5cynum_cBCsHandModelNonReflBcs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out, int __pyx_skip_dispatch) {
  PyObject *__pyx_v__A = NULL;
  PyObject *__pyx_v__q = NULL;
  CYTHON_UNUSED double __pyx_v_theta;
  CYTHON_UNUSED double __pyx_v_dt2;
  PyObject *__pyx_v_p_pres = NULL;
  PyObject *__pyx_v_A0 = NULL;
  PyObject *__pyx_v_A1 = NULL;
  PyObject *__pyx_v_f = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_A = NULL;
  double __pyx_v_W2_const;
  PyObject *__pyx_v_W2 = NULL;
  PyObject *__pyx_v_W1 = NULL;
  PyObject *__pyx_v_A_out = NULL;
  PyObject *__pyx_v_q_out = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  double __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  __Pyx_RefNannySetupContext("U_0", 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_U_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_1U_0)) {
      if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 2012, __pyx_L1_error) }
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 2012, __pyx_L1_error) }
      __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_out, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_9 = __pyx_t_1; __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_12 = PyTuple_New(6+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_11, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_11, __pyx_t_8);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":2013
 * cdef class cBCsHandModelNonReflBcs(cBCsWat):
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u             # <<<<<<<<<<<<<<
 *         theta = dt / dx
 *         dt2 = dt / 2.
 */
  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #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_ERR(0, 2013, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_9);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_9 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_9)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 2013, __pyx_L1_error)
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2013, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v__A = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v__q = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "pylsewave/cynum.pyx":2014
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):
 *         _A, _q = u
 *         theta = dt / dx             # <<<<<<<<<<<<<<
 *         dt2 = dt / 2.
 * 
 */
  if (unlikely(__pyx_v_dx == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 2014, __pyx_L1_error)
  }
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":2015
 *         _A, _q = u
 *         theta = dt / dx
 *         dt2 = dt / 2.             # <<<<<<<<<<<<<<
 * 
 *         p_pres = self.inlet_fun(t)
 */
  __pyx_v_dt2 = (__pyx_v_dt / 2.);

  /* "pylsewave/cynum.pyx":2017
 *         dt2 = dt / 2.
 * 
 *         p_pres = self.inlet_fun(t)             # <<<<<<<<<<<<<<
 * 
 *         A0 = np.pi*self.mesh.vessels[vessel_index].r0[0]**2.0
 */
  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.inlet_fun);
  __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.inlet_fun; __pyx_t_12 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_12) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2017, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); __pyx_t_12 = NULL;
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_p_pres = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":2019
 *         p_pres = self.inlet_fun(t)
 * 
 *         A0 = np.pi*self.mesh.vessels[vessel_index].r0[0]**2.0             # <<<<<<<<<<<<<<
 *         A1 = np.pi*self.mesh.vessels[vessel_index].r0[1]**2.0
 *         f = self.mesh.vessels[vessel_index].f_r0[0]
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_vessel_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_r0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Power(__pyx_t_8, __pyx_float_2_0, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_A0 = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":2020
 * 
 *         A0 = np.pi*self.mesh.vessels[vessel_index].r0[0]**2.0
 *         A1 = np.pi*self.mesh.vessels[vessel_index].r0[1]**2.0             # <<<<<<<<<<<<<<
 *         f = self.mesh.vessels[vessel_index].f_r0[0]
 * 
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_vessel_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_r0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Power(__pyx_t_2, __pyx_float_2_0, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_A1 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pylsewave/cynum.pyx":2021
 *         A0 = np.pi*self.mesh.vessels[vessel_index].r0[0]**2.0
 *         A1 = np.pi*self.mesh.vessels[vessel_index].r0[1]**2.0
 *         f = self.mesh.vessels[vessel_index].f_r0[0]             # <<<<<<<<<<<<<<
 * 
 *         A = A0*((p_pres /f) + 1)**2.0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_vessel_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_f_r0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_f = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":2023
 *         f = self.mesh.vessels[vessel_index].f_r0[0]
 * 
 *         A = A0*((p_pres /f) + 1)**2.0             # <<<<<<<<<<<<<<
 * 
 *         W2_const = -4.0*self.pdes.compute_c_i(A1, index=1, vessel_index=vessel_index)
 */
  __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_p_pres, __pyx_v_f); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Power(__pyx_t_2, __pyx_float_2_0, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_A0, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_A = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pylsewave/cynum.pyx":2025
 *         A = A0*((p_pres /f) + 1)**2.0
 * 
 *         W2_const = -4.0*self.pdes.compute_c_i(A1, index=1, vessel_index=vessel_index)             # <<<<<<<<<<<<<<
 * 
 *         W2 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)
 */
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_A1); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2025, __pyx_L1_error)
  __pyx_v_W2_const = (-4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.__pyx_base.pdes, __pyx_t_14, 1, __pyx_v_vessel_index, 0));

  /* "pylsewave/cynum.pyx":2027
 *         W2_const = -4.0*self.pdes.compute_c_i(A1, index=1, vessel_index=vessel_index)
 * 
 *         W2 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)             # <<<<<<<<<<<<<<
 * 
 *         W1 = W2_const + 8*np.sqrt(f/(2*self._rho))*(((p_pres/f) + 1)**(1/2.))
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v__q, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v__A, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v__A, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyFloat_FromDouble((4.0 * ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.__pyx_base.pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->__pyx_base.__pyx_base.pdes, __pyx_t_14, 1, __pyx_v_vessel_index, 0))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_W2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pylsewave/cynum.pyx":2029
 *         W2 = _q[1]/_A[1] - 4*self.pdes.compute_c_i(_A[1], index=1, vessel_index=vessel_index)
 * 
 *         W1 = W2_const + 8*np.sqrt(f/(2*self._rho))*(((p_pres/f) + 1)**(1/2.))             # <<<<<<<<<<<<<<
 * 
 *         A_out = A0*(((W1 - W2)/(4.))**4)*(((self._rho)/(2*f))**2)
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_W2_const); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble((2.0 * __pyx_v_self->__pyx_base.__pyx_base._rho)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_PyNumber_Divide(__pyx_v_f, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2029, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_8);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyNumber_Multiply(__pyx_int_8, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_p_pres, __pyx_v_f); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyFloat_FromDouble((1.0 / 2.)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_12 = PyNumber_Power(__pyx_t_7, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Multiply(__pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyNumber_Add(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_W1 = __pyx_t_12;
  __pyx_t_12 = 0;

  /* "pylsewave/cynum.pyx":2031
 *         W1 = W2_const + 8*np.sqrt(f/(2*self._rho))*(((p_pres/f) + 1)**(1/2.))
 * 
 *         A_out = A0*(((W1 - W2)/(4.))**4)*(((self._rho)/(2*f))**2)             # <<<<<<<<<<<<<<
 * #         A_out = (((W2 - W1)/(8.))**4)*(((2*self._rho)/(f))**2)*A0
 *         q_out = 0.5*A_out*(W1 + W2)
 */
  __pyx_t_12 = PyNumber_Subtract(__pyx_v_W1, __pyx_v_W2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = __Pyx_PyFloat_DivideObjC(__pyx_t_12, __pyx_float_4_, 4., 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyNumber_Power(__pyx_t_8, __pyx_int_4, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Multiply(__pyx_v_A0, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base._rho); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = PyNumber_Multiply(__pyx_int_2, __pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Power(__pyx_t_9, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyNumber_Multiply(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_A_out = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "pylsewave/cynum.pyx":2033
 *         A_out = A0*(((W1 - W2)/(4.))**4)*(((self._rho)/(2*f))**2)
 * #         A_out = (((W2 - W1)/(8.))**4)*(((2*self._rho)/(f))**2)*A0
 *         q_out = 0.5*A_out*(W1 + W2)             # <<<<<<<<<<<<<<
 * 
 *         out[0, 0] = A_out
 */
  __pyx_t_9 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_A_out); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = PyNumber_Add(__pyx_v_W1, __pyx_v_W2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyNumber_Multiply(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_q_out = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "pylsewave/cynum.pyx":2035
 *         q_out = 0.5*A_out*(W1 + W2)
 * 
 *         out[0, 0] = A_out             # <<<<<<<<<<<<<<
 *         out[1, 0] = q_out
 * 
 */
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_A_out); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2035, __pyx_L1_error)
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = -1;
  if (__pyx_t_15 < 0) {
    __pyx_t_15 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
  } else if (unlikely(__pyx_t_15 >= __pyx_v_out.shape[0])) __pyx_t_17 = 0;
  if (__pyx_t_16 < 0) {
    __pyx_t_16 += __pyx_v_out.shape[1];
    if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
  } else if (unlikely(__pyx_t_16 >= __pyx_v_out.shape[1])) __pyx_t_17 = 1;
  if (unlikely(__pyx_t_17 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_17);
    __PYX_ERR(0, 2035, __pyx_L1_error)
  }
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) )) + __pyx_t_16)) )) = __pyx_t_14;

  /* "pylsewave/cynum.pyx":2036
 * 
 *         out[0, 0] = A_out
 *         out[1, 0] = q_out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_q_out); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2036, __pyx_L1_error)
  __pyx_t_18 = 1;
  __pyx_t_19 = 0;
  __pyx_t_17 = -1;
  if (__pyx_t_18 < 0) {
    __pyx_t_18 += __pyx_v_out.shape[0];
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
  } else if (unlikely(__pyx_t_18 >= __pyx_v_out.shape[0])) __pyx_t_17 = 0;
  if (__pyx_t_19 < 0) {
    __pyx_t_19 += __pyx_v_out.shape[1];
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 1;
  } else if (unlikely(__pyx_t_19 >= __pyx_v_out.shape[1])) __pyx_t_17 = 1;
  if (unlikely(__pyx_t_17 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_17);
    __PYX_ERR(0, 2036, __pyx_L1_error)
  }
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_18 * __pyx_v_out.strides[0]) )) + __pyx_t_19)) )) = __pyx_t_14;

  /* "pylsewave/cynum.pyx":2012
 * 
 * cdef class cBCsHandModelNonReflBcs(cBCsWat):
 *     cpdef void U_0(self, double[:, ::1] u, double t, double dx, double dt, int vessel_index, double[:,::1] out):             # <<<<<<<<<<<<<<
 *         _A, _q = u
 *         theta = dt / dx
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_WriteUnraisable("pylsewave.cynum.cBCsHandModelNonReflBcs.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__A);
  __Pyx_XDECREF(__pyx_v__q);
  __Pyx_XDECREF(__pyx_v_p_pres);
  __Pyx_XDECREF(__pyx_v_A0);
  __Pyx_XDECREF(__pyx_v_A1);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_A);
  __Pyx_XDECREF(__pyx_v_W2);
  __Pyx_XDECREF(__pyx_v_W1);
  __Pyx_XDECREF(__pyx_v_A_out);
  __Pyx_XDECREF(__pyx_v_q_out);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_1U_0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_t;
  double __pyx_v_dx;
  double __pyx_v_dt;
  int __pyx_v_vessel_index;
  __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("U_0 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_t,&__pyx_n_s_dx,&__pyx_n_s_dt,&__pyx_n_s_vessel_index,&__pyx_n_s_out,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_u)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 1); __PYX_ERR(0, 2012, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 2); __PYX_ERR(0, 2012, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 3); __PYX_ERR(0, 2012, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 4); __PYX_ERR(0, 2012, __pyx_L3_error)
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, 5); __PYX_ERR(0, 2012, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "U_0") < 0)) __PYX_ERR(0, 2012, __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_u = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 2012, __pyx_L3_error)
    __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2012, __pyx_L3_error)
    __pyx_v_dx = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2012, __pyx_L3_error)
    __pyx_v_dt = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2012, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2012, __pyx_L3_error)
    __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[5]); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 2012, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("U_0", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2012, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cBCsHandModelNonReflBcs.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_U_0(((struct __pyx_obj_9pylsewave_5cynum_cBCsHandModelNonReflBcs *)__pyx_v_self), __pyx_v_u, __pyx_v_t, __pyx_v_dx, __pyx_v_dt, __pyx_v_vessel_index, __pyx_v_out);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_U_0(struct __pyx_obj_9pylsewave_5cynum_cBCsHandModelNonReflBcs *__pyx_v_self, __Pyx_memviewslice __pyx_v_u, double __pyx_v_t, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index, __Pyx_memviewslice __pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("U_0", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_u.memview)) { __Pyx_RaiseUnboundLocalError("u"); __PYX_ERR(0, 2012, __pyx_L1_error) }
  if (unlikely(!__pyx_v_out.memview)) { __Pyx_RaiseUnboundLocalError("out"); __PYX_ERR(0, 2012, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_U_0(__pyx_v_self, __pyx_v_u, __pyx_v_t, __pyx_v_dx, __pyx_v_dt, __pyx_v_vessel_index, __pyx_v_out, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2012, __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("pylsewave.cynum.cBCsHandModelNonReflBcs.U_0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2056
 *     cdef double _C
 * 
 *     def __init__(self, cBCs bcs):             # <<<<<<<<<<<<<<
 *         self._bcs = bcs
 *         self._pdes = self._bcs.get_pdes()
 */

/* Python wrapper */
static int __pyx_pw_9pylsewave_5cynum_10cFDMSolver_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pylsewave_5cynum_10cFDMSolver_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_bcs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bcs,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_bcs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2056, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_bcs = ((struct __pyx_obj_9pylsewave_5cynum_cBCs *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2056, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cFDMSolver.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bcs), __pyx_ptype_9pylsewave_5cynum_cBCs, 1, "bcs", 0))) __PYX_ERR(0, 2056, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pylsewave_5cynum_10cFDMSolver___init__(((struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self), __pyx_v_bcs);

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

static int __pyx_pf_9pylsewave_5cynum_10cFDMSolver___init__(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_bcs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pylsewave/cynum.pyx":2057
 * 
 *     def __init__(self, cBCs bcs):
 *         self._bcs = bcs             # <<<<<<<<<<<<<<
 *         self._pdes = self._bcs.get_pdes()
 *         self.mesh = self._bcs.get_pdes().mesh
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bcs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bcs));
  __Pyx_GOTREF(__pyx_v_self->_bcs);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_bcs));
  __pyx_v_self->_bcs = __pyx_v_bcs;

  /* "pylsewave/cynum.pyx":2058
 *     def __init__(self, cBCs bcs):
 *         self._bcs = bcs
 *         self._pdes = self._bcs.get_pdes()             # <<<<<<<<<<<<<<
 *         self.mesh = self._bcs.get_pdes().mesh
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_self->_bcs->__pyx_vtab)->get_pdes(__pyx_v_self->_bcs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_pdes);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_pdes));
  __pyx_v_self->_pdes = ((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":2059
 *         self._bcs = bcs
 *         self._pdes = self._bcs.get_pdes()
 *         self.mesh = self._bcs.get_pdes().mesh             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_self->_bcs->__pyx_vtab)->get_pdes(__pyx_v_self->_bcs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)__pyx_t_1)->mesh;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->mesh);
  __Pyx_DECREF(__pyx_v_self->mesh);
  __pyx_v_self->mesh = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pylsewave/cynum.pyx":2056
 *     cdef double _C
 * 
 *     def __init__(self, cBCs bcs):             # <<<<<<<<<<<<<<
 *         self._bcs = bcs
 *         self._pdes = self._bcs.get_pdes()
 */

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

/* "pylsewave/cynum.pyx":2062
 * 
 *     @property
 *     def mesh(self):             # <<<<<<<<<<<<<<
 *         return self.mesh
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_10cFDMSolver_4mesh_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_10cFDMSolver_4mesh_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pylsewave_5cynum_10cFDMSolver_4mesh___get__(((struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pylsewave_5cynum_10cFDMSolver_4mesh___get__(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pylsewave/cynum.pyx":2063
 *     @property
 *     def mesh(self):
 *         return self.mesh             # <<<<<<<<<<<<<<
 * 
 *     cpdef void set_T(self, double dt, double T, int no_cycles):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->mesh);
  __pyx_r = __pyx_v_self->mesh;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":2062
 * 
 *     @property
 *     def mesh(self):             # <<<<<<<<<<<<<<
 *         return self.mesh
 * 
 */

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

/* "pylsewave/cynum.pyx":2065
 *         return self.mesh
 * 
 *     cpdef void set_T(self, double dt, double T, int no_cycles):             # <<<<<<<<<<<<<<
 *         self._no_cycles = no_cycles
 *         self._T = T
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_10cFDMSolver_3set_T(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_10cFDMSolver_set_T(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, double __pyx_v_dt, double __pyx_v_T, int __pyx_v_no_cycles, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_RefNannySetupContext("set_T", 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_set_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2065, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_10cFDMSolver_3set_T)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2065, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2065, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_no_cycles); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2065, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __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(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2065, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2065, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":2066
 * 
 *     cpdef void set_T(self, double dt, double T, int no_cycles):
 *         self._no_cycles = no_cycles             # <<<<<<<<<<<<<<
 *         self._T = T
 *         self._dt = dt
 */
  __pyx_v_self->_no_cycles = __pyx_v_no_cycles;

  /* "pylsewave/cynum.pyx":2067
 *     cpdef void set_T(self, double dt, double T, int no_cycles):
 *         self._no_cycles = no_cycles
 *         self._T = T             # <<<<<<<<<<<<<<
 *         self._dt = dt
 *         self._Nt = int(round(self._T / self._dt))
 */
  __pyx_v_self->_T = __pyx_v_T;

  /* "pylsewave/cynum.pyx":2068
 *         self._no_cycles = no_cycles
 *         self._T = T
 *         self._dt = dt             # <<<<<<<<<<<<<<
 *         self._Nt = int(round(self._T / self._dt))
 *         self._t = np.linspace(0.0, self._Nt*self._dt, self._Nt + 1)
 */
  __pyx_v_self->_dt = __pyx_v_dt;

  /* "pylsewave/cynum.pyx":2069
 *         self._T = T
 *         self._dt = dt
 *         self._Nt = int(round(self._T / self._dt))             # <<<<<<<<<<<<<<
 *         self._t = np.linspace(0.0, self._Nt*self._dt, self._Nt + 1)
 *         self._pdes.set_boundary_layer_th(T, no_cycles)
 */
  if (unlikely(__pyx_v_self->_dt == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 2069, __pyx_L1_error)
  }
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->_T / __pyx_v_self->_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->_Nt = __pyx_t_10;

  /* "pylsewave/cynum.pyx":2070
 *         self._dt = dt
 *         self._Nt = int(round(self._T / self._dt))
 *         self._t = np.linspace(0.0, self._Nt*self._dt, self._Nt + 1)             # <<<<<<<<<<<<<<
 *         self._pdes.set_boundary_layer_th(T, no_cycles)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_linspace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->_Nt * __pyx_v_self->_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyInt_From_long((__pyx_v_self->_Nt + 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_8, __pyx_t_9);
  __pyx_t_1 = 0;
  __pyx_t_9 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
  if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2070, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_t, 0);
  __pyx_v_self->_t = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "pylsewave/cynum.pyx":2071
 *         self._Nt = int(round(self._T / self._dt))
 *         self._t = np.linspace(0.0, self._Nt*self._dt, self._Nt + 1)
 *         self._pdes.set_boundary_layer_th(T, no_cycles)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->set_boundary_layer_th(__pyx_v_self->_pdes, __pyx_v_T, __pyx_v_no_cycles, 0);

  /* "pylsewave/cynum.pyx":2065
 *         return self.mesh
 * 
 *     cpdef void set_T(self, double dt, double T, int no_cycles):             # <<<<<<<<<<<<<<
 *         self._no_cycles = no_cycles
 *         self._T = T
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cFDMSolver.set_T", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_10cFDMSolver_3set_T(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_10cFDMSolver_3set_T(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_dt;
  double __pyx_v_T;
  int __pyx_v_no_cycles;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_T (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dt,&__pyx_n_s_T,&__pyx_n_s_no_cycles,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_dt)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_T)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_T", 1, 3, 3, 1); __PYX_ERR(0, 2065, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_no_cycles)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_T", 1, 3, 3, 2); __PYX_ERR(0, 2065, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_T") < 0)) __PYX_ERR(0, 2065, __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_dt = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2065, __pyx_L3_error)
    __pyx_v_T = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_T == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2065, __pyx_L3_error)
    __pyx_v_no_cycles = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_no_cycles == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2065, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_T", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2065, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cFDMSolver.set_T", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_10cFDMSolver_2set_T(((struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self), __pyx_v_dt, __pyx_v_T, __pyx_v_no_cycles);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_10cFDMSolver_2set_T(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, double __pyx_v_dt, double __pyx_v_T, int __pyx_v_no_cycles) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_T", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_10cFDMSolver_set_T(__pyx_v_self, __pyx_v_dt, __pyx_v_T, __pyx_v_no_cycles, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2065, __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("pylsewave.cynum.cFDMSolver.set_T", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2074
 * 
 * 
 *     cpdef void set_BC(self, int[::1] U0_array,             # <<<<<<<<<<<<<<
 *                  int[::1] UL_array, int[:, ::1] UBif_array,
 *                  int[:,::1] UConj_array):
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_10cFDMSolver_5set_BC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_9pylsewave_5cynum_10cFDMSolver_set_BC(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, __Pyx_memviewslice __pyx_v_U0_array, __Pyx_memviewslice __pyx_v_UL_array, __Pyx_memviewslice __pyx_v_UBif_array, __Pyx_memviewslice __pyx_v_UConj_array, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("set_BC", 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_set_BC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_10cFDMSolver_5set_BC)) {
      if (unlikely(!__pyx_v_U0_array.memview)) { __Pyx_RaiseUnboundLocalError("U0_array"); __PYX_ERR(0, 2074, __pyx_L1_error) }
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_U0_array, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2074, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(!__pyx_v_UL_array.memview)) { __Pyx_RaiseUnboundLocalError("UL_array"); __PYX_ERR(0, 2074, __pyx_L1_error) }
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_UL_array, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2074, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(!__pyx_v_UBif_array.memview)) { __Pyx_RaiseUnboundLocalError("UBif_array"); __PYX_ERR(0, 2074, __pyx_L1_error) }
      __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_UBif_array, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2074, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(!__pyx_v_UConj_array.memview)) { __Pyx_RaiseUnboundLocalError("UConj_array"); __PYX_ERR(0, 2074, __pyx_L1_error) }
      __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_UConj_array, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2074, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_9 = 1;
        }
      }
      __pyx_t_10 = PyTuple_New(4+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2074, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_t_6);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2074, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__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;
  }

  /* "pylsewave/cynum.pyx":2077
 *                  int[::1] UL_array, int[:, ::1] UBif_array,
 *                  int[:,::1] UConj_array):
 *         self.U0_arr = U0_array             # <<<<<<<<<<<<<<
 *         self.UL_arr = UL_array
 *         self.UBif_arr = UBif_array
 */
  __PYX_XDEC_MEMVIEW(&__pyx_v_self->U0_arr, 0);
  __PYX_INC_MEMVIEW(&__pyx_v_U0_array, 0);
  __pyx_v_self->U0_arr = __pyx_v_U0_array;

  /* "pylsewave/cynum.pyx":2078
 *                  int[:,::1] UConj_array):
 *         self.U0_arr = U0_array
 *         self.UL_arr = UL_array             # <<<<<<<<<<<<<<
 *         self.UBif_arr = UBif_array
 *         self.UConj_arr = UConj_array
 */
  __PYX_XDEC_MEMVIEW(&__pyx_v_self->UL_arr, 0);
  __PYX_INC_MEMVIEW(&__pyx_v_UL_array, 0);
  __pyx_v_self->UL_arr = __pyx_v_UL_array;

  /* "pylsewave/cynum.pyx":2079
 *         self.U0_arr = U0_array
 *         self.UL_arr = UL_array
 *         self.UBif_arr = UBif_array             # <<<<<<<<<<<<<<
 *         self.UConj_arr = UConj_array
 * 
 */
  __PYX_XDEC_MEMVIEW(&__pyx_v_self->UBif_arr, 0);
  __PYX_INC_MEMVIEW(&__pyx_v_UBif_array, 0);
  __pyx_v_self->UBif_arr = __pyx_v_UBif_array;

  /* "pylsewave/cynum.pyx":2080
 *         self.UL_arr = UL_array
 *         self.UBif_arr = UBif_array
 *         self.UConj_arr = UConj_array             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  __PYX_XDEC_MEMVIEW(&__pyx_v_self->UConj_arr, 0);
  __PYX_INC_MEMVIEW(&__pyx_v_UConj_array, 0);
  __pyx_v_self->UConj_arr = __pyx_v_UConj_array;

  /* "pylsewave/cynum.pyx":2074
 * 
 * 
 *     cpdef void set_BC(self, int[::1] U0_array,             # <<<<<<<<<<<<<<
 *                  int[::1] UL_array, int[:, ::1] UBif_array,
 *                  int[:,::1] UConj_array):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_WriteUnraisable("pylsewave.cynum.cFDMSolver.set_BC", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_10cFDMSolver_5set_BC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_10cFDMSolver_5set_BC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_U0_array = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_UL_array = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_UBif_array = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_UConj_array = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_BC (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_U0_array,&__pyx_n_s_UL_array,&__pyx_n_s_UBif_array,&__pyx_n_s_UConj_array,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_U0_array)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_UL_array)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_BC", 1, 4, 4, 1); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_UBif_array)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_BC", 1, 4, 4, 2); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_UConj_array)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_BC", 1, 4, 4, 3); __PYX_ERR(0, 2074, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_BC") < 0)) __PYX_ERR(0, 2074, __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_U0_array = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[0]); if (unlikely(!__pyx_v_U0_array.memview)) __PYX_ERR(0, 2074, __pyx_L3_error)
    __pyx_v_UL_array = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[1]); if (unlikely(!__pyx_v_UL_array.memview)) __PYX_ERR(0, 2075, __pyx_L3_error)
    __pyx_v_UBif_array = __Pyx_PyObject_to_MemoryviewSlice_d_dc_int(values[2]); if (unlikely(!__pyx_v_UBif_array.memview)) __PYX_ERR(0, 2075, __pyx_L3_error)
    __pyx_v_UConj_array = __Pyx_PyObject_to_MemoryviewSlice_d_dc_int(values[3]); if (unlikely(!__pyx_v_UConj_array.memview)) __PYX_ERR(0, 2076, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_BC", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2074, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cFDMSolver.set_BC", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_10cFDMSolver_4set_BC(((struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self), __pyx_v_U0_array, __pyx_v_UL_array, __pyx_v_UBif_array, __pyx_v_UConj_array);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_10cFDMSolver_4set_BC(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, __Pyx_memviewslice __pyx_v_U0_array, __Pyx_memviewslice __pyx_v_UL_array, __Pyx_memviewslice __pyx_v_UBif_array, __Pyx_memviewslice __pyx_v_UConj_array) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_BC", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_U0_array.memview)) { __Pyx_RaiseUnboundLocalError("U0_array"); __PYX_ERR(0, 2074, __pyx_L1_error) }
  if (unlikely(!__pyx_v_UL_array.memview)) { __Pyx_RaiseUnboundLocalError("UL_array"); __PYX_ERR(0, 2074, __pyx_L1_error) }
  if (unlikely(!__pyx_v_UBif_array.memview)) { __Pyx_RaiseUnboundLocalError("UBif_array"); __PYX_ERR(0, 2074, __pyx_L1_error) }
  if (unlikely(!__pyx_v_UConj_array.memview)) { __Pyx_RaiseUnboundLocalError("UConj_array"); __PYX_ERR(0, 2074, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pylsewave_5cynum_10cFDMSolver_set_BC(__pyx_v_self, __pyx_v_U0_array, __pyx_v_UL_array, __pyx_v_UBif_array, __pyx_v_UConj_array, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2074, __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("pylsewave.cynum.cFDMSolver.set_BC", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_U0_array, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_UL_array, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_UBif_array, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_UConj_array, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2086
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef CFL cfl_i(self, double[::1] uin, double dx, double dt, int index, int vessel_index):             # <<<<<<<<<<<<<<
 *         cdef double _A, _q, theta, c, u, ls, rs, comp_elem
 *         cdef double[::1] W = np.zeros(2, dtype=np.float)
 */

static enum __pyx_t_9pylsewave_5cynum_CFL __pyx_f_9pylsewave_5cynum_10cFDMSolver_cfl_i(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, __Pyx_memviewslice __pyx_v_uin, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_index, int __pyx_v_vessel_index) {
  double __pyx_v__A;
  double __pyx_v__q;
  double __pyx_v_theta;
  double __pyx_v_c;
  double __pyx_v_u;
  double __pyx_v_comp_elem;
  __Pyx_memviewslice __pyx_v_W = { 0, 0, { 0 }, { 0 }, { 0 } };
  enum __pyx_t_9pylsewave_5cynum_CFL __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  __Pyx_RefNannySetupContext("cfl_i", 0);

  /* "pylsewave/cynum.pyx":2088
 *     cdef CFL cfl_i(self, double[::1] uin, double dx, double dt, int index, int vessel_index):
 *         cdef double _A, _q, theta, c, u, ls, rs, comp_elem
 *         cdef double[::1] W = np.zeros(2, dtype=np.float)             # <<<<<<<<<<<<<<
 *         cdef int i
 *         _A = uin[0]
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_4);
  if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_W = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;

  /* "pylsewave/cynum.pyx":2090
 *         cdef double[::1] W = np.zeros(2, dtype=np.float)
 *         cdef int i
 *         _A = uin[0]             # <<<<<<<<<<<<<<
 *         _q = uin[1]
 *         theta = dt / dx
 */
  __pyx_t_6 = 0;
  __pyx_v__A = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_uin.data) + __pyx_t_6)) )));

  /* "pylsewave/cynum.pyx":2091
 *         cdef int i
 *         _A = uin[0]
 *         _q = uin[1]             # <<<<<<<<<<<<<<
 *         theta = dt / dx
 *         c = self._pdes.compute_c_i(_A, index, vessel_index)
 */
  __pyx_t_7 = 1;
  __pyx_v__q = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_uin.data) + __pyx_t_7)) )));

  /* "pylsewave/cynum.pyx":2092
 *         _A = uin[0]
 *         _q = uin[1]
 *         theta = dt / dx             # <<<<<<<<<<<<<<
 *         c = self._pdes.compute_c_i(_A, index, vessel_index)
 *         u = _q / _A
 */
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":2093
 *         _q = uin[1]
 *         theta = dt / dx
 *         c = self._pdes.compute_c_i(_A, index, vessel_index)             # <<<<<<<<<<<<<<
 *         u = _q / _A
 *         W[0] = abs(u + c)
 */
  __pyx_v_c = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->_pdes, __pyx_v__A, __pyx_v_index, __pyx_v_vessel_index, 0);

  /* "pylsewave/cynum.pyx":2094
 *         theta = dt / dx
 *         c = self._pdes.compute_c_i(_A, index, vessel_index)
 *         u = _q / _A             # <<<<<<<<<<<<<<
 *         W[0] = abs(u + c)
 *         W[1] = abs(u - c)
 */
  __pyx_v_u = (__pyx_v__q / __pyx_v__A);

  /* "pylsewave/cynum.pyx":2095
 *         c = self._pdes.compute_c_i(_A, index, vessel_index)
 *         u = _q / _A
 *         W[0] = abs(u + c)             # <<<<<<<<<<<<<<
 *         W[1] = abs(u - c)
 *         if ((1./W[0]) <= (1./W[1])) == True:
 */
  __pyx_t_8 = 0;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_W.data) + __pyx_t_8)) )) = fabs((__pyx_v_u + __pyx_v_c));

  /* "pylsewave/cynum.pyx":2096
 *         u = _q / _A
 *         W[0] = abs(u + c)
 *         W[1] = abs(u - c)             # <<<<<<<<<<<<<<
 *         if ((1./W[0]) <= (1./W[1])) == True:
 *             comp_elem = 1./W[0]
 */
  __pyx_t_9 = 1;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_W.data) + __pyx_t_9)) )) = fabs((__pyx_v_u - __pyx_v_c));

  /* "pylsewave/cynum.pyx":2097
 *         W[0] = abs(u + c)
 *         W[1] = abs(u - c)
 *         if ((1./W[0]) <= (1./W[1])) == True:             # <<<<<<<<<<<<<<
 *             comp_elem = 1./W[0]
 *         else:
 */
  __pyx_t_10 = 0;
  __pyx_t_11 = 1;
  __pyx_t_12 = ((((1. / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_W.data) + __pyx_t_10)) )))) <= (1. / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_W.data) + __pyx_t_11)) ))))) == 1) != 0);
  if (__pyx_t_12) {

    /* "pylsewave/cynum.pyx":2098
 *         W[1] = abs(u - c)
 *         if ((1./W[0]) <= (1./W[1])) == True:
 *             comp_elem = 1./W[0]             # <<<<<<<<<<<<<<
 *         else:
 *             comp_elem = 1./W[1]
 */
    __pyx_t_13 = 0;
    __pyx_v_comp_elem = (1. / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_W.data) + __pyx_t_13)) ))));

    /* "pylsewave/cynum.pyx":2097
 *         W[0] = abs(u + c)
 *         W[1] = abs(u - c)
 *         if ((1./W[0]) <= (1./W[1])) == True:             # <<<<<<<<<<<<<<
 *             comp_elem = 1./W[0]
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pylsewave/cynum.pyx":2100
 *             comp_elem = 1./W[0]
 *         else:
 *             comp_elem = 1./W[1]             # <<<<<<<<<<<<<<
 *         if (theta < comp_elem) == True:
 *             return CFL.CFL_STATUS_OK
 */
  /*else*/ {
    __pyx_t_14 = 1;
    __pyx_v_comp_elem = (1. / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_W.data) + __pyx_t_14)) ))));
  }
  __pyx_L3:;

  /* "pylsewave/cynum.pyx":2101
 *         else:
 *             comp_elem = 1./W[1]
 *         if (theta < comp_elem) == True:             # <<<<<<<<<<<<<<
 *             return CFL.CFL_STATUS_OK
 *         else:
 */
  __pyx_t_12 = (((__pyx_v_theta < __pyx_v_comp_elem) == 1) != 0);
  if (__pyx_t_12) {

    /* "pylsewave/cynum.pyx":2102
 *             comp_elem = 1./W[1]
 *         if (theta < comp_elem) == True:
 *             return CFL.CFL_STATUS_OK             # <<<<<<<<<<<<<<
 *         else:
 *             return CFL.CFL_STATUS_ERROR
 */
    __pyx_r = __pyx_e_9pylsewave_5cynum_CFL_STATUS_OK;
    goto __pyx_L0;

    /* "pylsewave/cynum.pyx":2101
 *         else:
 *             comp_elem = 1./W[1]
 *         if (theta < comp_elem) == True:             # <<<<<<<<<<<<<<
 *             return CFL.CFL_STATUS_OK
 *         else:
 */
  }

  /* "pylsewave/cynum.pyx":2104
 *             return CFL.CFL_STATUS_OK
 *         else:
 *             return CFL.CFL_STATUS_ERROR             # <<<<<<<<<<<<<<
 * 
 *     @cython.initializedcheck(False)
 */
  /*else*/ {
    __pyx_r = __pyx_e_9pylsewave_5cynum_CFL_STATUS_ERROR;
    goto __pyx_L0;
  }

  /* "pylsewave/cynum.pyx":2086
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef CFL cfl_i(self, double[::1] uin, double dx, double dt, int index, int vessel_index):             # <<<<<<<<<<<<<<
 *         cdef double _A, _q, theta, c, u, ls, rs, comp_elem
 *         cdef double[::1] W = np.zeros(2, dtype=np.float)
 */

  /* 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_XDEC_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cFDMSolver.cfl_i", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = (enum __pyx_t_9pylsewave_5cynum_CFL) 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_W, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2110
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef CFL cfl_condition(self, double[:, ::1] uin, double dx, double dt, int vessel_index):             # <<<<<<<<<<<<<<
 *         cdef double _A, _q, theta, c, u, ls, rs, comp_elem
 *         cdef double[::1] W = np.zeros(2, dtype=np.float)
 */

static enum __pyx_t_9pylsewave_5cynum_CFL __pyx_f_9pylsewave_5cynum_10cFDMSolver_cfl_condition(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, __Pyx_memviewslice __pyx_v_uin, double __pyx_v_dx, double __pyx_v_dt, int __pyx_v_vessel_index) {
  double __pyx_v_theta;
  double __pyx_v_c;
  __Pyx_memviewslice __pyx_v_W = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_i;
  int __pyx_v_size;
  double __pyx_v_min_value;
  enum __pyx_t_9pylsewave_5cynum_CFL __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __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;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  int __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  __Pyx_RefNannySetupContext("cfl_condition", 0);

  /* "pylsewave/cynum.pyx":2112
 *     cdef CFL cfl_condition(self, double[:, ::1] uin, double dx, double dt, int vessel_index):
 *         cdef double _A, _q, theta, c, u, ls, rs, comp_elem
 *         cdef double[::1] W = np.zeros(2, dtype=np.float)             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef int size
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 2112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_4);
  if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_W = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;

  /* "pylsewave/cynum.pyx":2117
 *         cdef double min_value
 * 
 *         size = uin.shape[1]             # <<<<<<<<<<<<<<
 *         W = np.zeros(size, dtype=np.float)
 *         theta = dt / dx
 */
  __pyx_v_size = (__pyx_v_uin.shape[1]);

  /* "pylsewave/cynum.pyx":2118
 * 
 *         size = uin.shape[1]
 *         W = np.zeros(size, dtype=np.float)             # <<<<<<<<<<<<<<
 *         theta = dt / dx
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
  if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __PYX_XDEC_MEMVIEW(&__pyx_v_W, 1);
  __pyx_v_W = __pyx_t_5;
  __pyx_t_5.memview = NULL;
  __pyx_t_5.data = NULL;

  /* "pylsewave/cynum.pyx":2119
 *         size = uin.shape[1]
 *         W = np.zeros(size, dtype=np.float)
 *         theta = dt / dx             # <<<<<<<<<<<<<<
 * 
 *         c = self._pdes.compute_c_i(uin[0, 0], 0, vessel_index)
 */
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":2121
 *         theta = dt / dx
 * 
 *         c = self._pdes.compute_c_i(uin[0, 0], 0, vessel_index)             # <<<<<<<<<<<<<<
 *         W[0] = fabs(1.0 / ((uin[1, 0]/uin[0, 0]) + c))
 *         min_value = W[0]
 */
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_v_c = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->_pdes, (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_uin.data + __pyx_t_7 * __pyx_v_uin.strides[0]) )) + __pyx_t_8)) ))), 0, __pyx_v_vessel_index, 0);

  /* "pylsewave/cynum.pyx":2122
 * 
 *         c = self._pdes.compute_c_i(uin[0, 0], 0, vessel_index)
 *         W[0] = fabs(1.0 / ((uin[1, 0]/uin[0, 0]) + c))             # <<<<<<<<<<<<<<
 *         min_value = W[0]
 * 
 */
  __pyx_t_9 = 1;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_W.data) + __pyx_t_13)) )) = fabs((1.0 / (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_uin.data + __pyx_t_9 * __pyx_v_uin.strides[0]) )) + __pyx_t_10)) ))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_uin.data + __pyx_t_11 * __pyx_v_uin.strides[0]) )) + __pyx_t_12)) )))) + __pyx_v_c)));

  /* "pylsewave/cynum.pyx":2123
 *         c = self._pdes.compute_c_i(uin[0, 0], 0, vessel_index)
 *         W[0] = fabs(1.0 / ((uin[1, 0]/uin[0, 0]) + c))
 *         min_value = W[0]             # <<<<<<<<<<<<<<
 * 
 *         for i in range(1, size):
 */
  __pyx_t_14 = 0;
  __pyx_v_min_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_W.data) + __pyx_t_14)) )));

  /* "pylsewave/cynum.pyx":2125
 *         min_value = W[0]
 * 
 *         for i in range(1, size):             # <<<<<<<<<<<<<<
 *             c = self._pdes.compute_c_i(uin[0, i], i, vessel_index)
 *             W[i] = fabs(1.0 / ((uin[1, i]/uin[0, i]) + c))
 */
  __pyx_t_15 = __pyx_v_size;
  for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
    __pyx_v_i = __pyx_t_16;

    /* "pylsewave/cynum.pyx":2126
 * 
 *         for i in range(1, size):
 *             c = self._pdes.compute_c_i(uin[0, i], i, vessel_index)             # <<<<<<<<<<<<<<
 *             W[i] = fabs(1.0 / ((uin[1, i]/uin[0, i]) + c))
 *             if W[i] < min_value:
 */
    __pyx_t_17 = 0;
    __pyx_t_18 = __pyx_v_i;
    __pyx_v_c = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->compute_c_i(__pyx_v_self->_pdes, (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_uin.data + __pyx_t_17 * __pyx_v_uin.strides[0]) )) + __pyx_t_18)) ))), __pyx_v_i, __pyx_v_vessel_index, 0);

    /* "pylsewave/cynum.pyx":2127
 *         for i in range(1, size):
 *             c = self._pdes.compute_c_i(uin[0, i], i, vessel_index)
 *             W[i] = fabs(1.0 / ((uin[1, i]/uin[0, i]) + c))             # <<<<<<<<<<<<<<
 *             if W[i] < min_value:
 *                 min_value = W[i]
 */
    __pyx_t_19 = 1;
    __pyx_t_20 = __pyx_v_i;
    __pyx_t_21 = 0;
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_23 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_W.data) + __pyx_t_23)) )) = fabs((1.0 / (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_uin.data + __pyx_t_19 * __pyx_v_uin.strides[0]) )) + __pyx_t_20)) ))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_uin.data + __pyx_t_21 * __pyx_v_uin.strides[0]) )) + __pyx_t_22)) )))) + __pyx_v_c)));

    /* "pylsewave/cynum.pyx":2128
 *             c = self._pdes.compute_c_i(uin[0, i], i, vessel_index)
 *             W[i] = fabs(1.0 / ((uin[1, i]/uin[0, i]) + c))
 *             if W[i] < min_value:             # <<<<<<<<<<<<<<
 *                 min_value = W[i]
 * 
 */
    __pyx_t_24 = __pyx_v_i;
    __pyx_t_25 = (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_W.data) + __pyx_t_24)) ))) < __pyx_v_min_value) != 0);
    if (__pyx_t_25) {

      /* "pylsewave/cynum.pyx":2129
 *             W[i] = fabs(1.0 / ((uin[1, i]/uin[0, i]) + c))
 *             if W[i] < min_value:
 *                 min_value = W[i]             # <<<<<<<<<<<<<<
 * 
 *         if (theta < min_value) == True:
 */
      __pyx_t_26 = __pyx_v_i;
      __pyx_v_min_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_W.data) + __pyx_t_26)) )));

      /* "pylsewave/cynum.pyx":2128
 *             c = self._pdes.compute_c_i(uin[0, i], i, vessel_index)
 *             W[i] = fabs(1.0 / ((uin[1, i]/uin[0, i]) + c))
 *             if W[i] < min_value:             # <<<<<<<<<<<<<<
 *                 min_value = W[i]
 * 
 */
    }
  }

  /* "pylsewave/cynum.pyx":2131
 *                 min_value = W[i]
 * 
 *         if (theta < min_value) == True:             # <<<<<<<<<<<<<<
 *             return CFL.CFL_STATUS_OK
 *         else:
 */
  __pyx_t_25 = (((__pyx_v_theta < __pyx_v_min_value) == 1) != 0);
  if (__pyx_t_25) {

    /* "pylsewave/cynum.pyx":2132
 * 
 *         if (theta < min_value) == True:
 *             return CFL.CFL_STATUS_OK             # <<<<<<<<<<<<<<
 *         else:
 *             return CFL.CFL_STATUS_ERROR
 */
    __pyx_r = __pyx_e_9pylsewave_5cynum_CFL_STATUS_OK;
    goto __pyx_L0;

    /* "pylsewave/cynum.pyx":2131
 *                 min_value = W[i]
 * 
 *         if (theta < min_value) == True:             # <<<<<<<<<<<<<<
 *             return CFL.CFL_STATUS_OK
 *         else:
 */
  }

  /* "pylsewave/cynum.pyx":2134
 *             return CFL.CFL_STATUS_OK
 *         else:
 *             return CFL.CFL_STATUS_ERROR             # <<<<<<<<<<<<<<
 * 
 *     cdef void initialise_solution_vector(self, vector[U] &vectorU, int length):
 */
  /*else*/ {
    __pyx_r = __pyx_e_9pylsewave_5cynum_CFL_STATUS_ERROR;
    goto __pyx_L0;
  }

  /* "pylsewave/cynum.pyx":2110
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef CFL cfl_condition(self, double[:, ::1] uin, double dx, double dt, int vessel_index):             # <<<<<<<<<<<<<<
 *         cdef double _A, _q, theta, c, u, ls, rs, comp_elem
 *         cdef double[::1] W = np.zeros(2, dtype=np.float)
 */

  /* 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_XDEC_MEMVIEW(&__pyx_t_5, 1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("pylsewave.cynum.cFDMSolver.cfl_condition", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = (enum __pyx_t_9pylsewave_5cynum_CFL) 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_W, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2136
 *             return CFL.CFL_STATUS_ERROR
 * 
 *     cdef void initialise_solution_vector(self, vector[U] &vectorU, int length):             # <<<<<<<<<<<<<<
 *         if isinstance(self, cLaxWendroffSolver):
 *             for i in range(length):
 */

static void __pyx_f_9pylsewave_5cynum_10cFDMSolver_initialise_solution_vector(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, std::vector<struct __pyx_t_9pylsewave_5cynum_U>  &__pyx_v_vectorU, int __pyx_v_length) {
  int __pyx_v_i;
  PyObject *__pyx_v_siz_i = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_t_12;
  __Pyx_RefNannySetupContext("initialise_solution_vector", 0);

  /* "pylsewave/cynum.pyx":2137
 * 
 *     cdef void initialise_solution_vector(self, vector[U] &vectorU, int length):
 *         if isinstance(self, cLaxWendroffSolver):             # <<<<<<<<<<<<<<
 *             for i in range(length):
 *                 siz_i = self.mesh.vessels[i].x.shape[0]
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_ptype_9pylsewave_5cynum_cLaxWendroffSolver); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pylsewave/cynum.pyx":2138
 *     cdef void initialise_solution_vector(self, vector[U] &vectorU, int length):
 *         if isinstance(self, cLaxWendroffSolver):
 *             for i in range(length):             # <<<<<<<<<<<<<<
 *                 siz_i = self.mesh.vessels[i].x.shape[0]
 *                 vectorU[i].x_size = siz_i
 */
    __pyx_t_3 = __pyx_v_length;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "pylsewave/cynum.pyx":2139
 *         if isinstance(self, cLaxWendroffSolver):
 *             for i in range(length):
 *                 siz_i = self.mesh.vessels[i].x.shape[0]             # <<<<<<<<<<<<<<
 *                 vectorU[i].x_size = siz_i
 *                 vectorU[i].u = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_siz_i, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pylsewave/cynum.pyx":2140
 *             for i in range(length):
 *                 siz_i = self.mesh.vessels[i].x.shape[0]
 *                 vectorU[i].x_size = siz_i             # <<<<<<<<<<<<<<
 *                 vectorU[i].u = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_n = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_siz_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2140, __pyx_L1_error)
      (__pyx_v_vectorU[__pyx_v_i]).x_size = __pyx_t_7;

      /* "pylsewave/cynum.pyx":2141
 *                 siz_i = self.mesh.vessels[i].x.shape[0]
 *                 vectorU[i].x_size = siz_i
 *                 vectorU[i].u = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].u_n = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_store = np.zeros((3, siz_i), dtype=np.float)
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 2141, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_10);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2141, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).u, 0);
      (__pyx_v_vectorU[__pyx_v_i]).u = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2142
 *                 vectorU[i].x_size = siz_i
 *                 vectorU[i].u = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_n = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].u_store = np.zeros((3, siz_i), dtype=np.float)
 *                 vectorU[i].dx = self.mesh.vessels[i].dx
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 2142, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_9);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2142, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).u_n, 0);
      (__pyx_v_vectorU[__pyx_v_i]).u_n = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2143
 *                 vectorU[i].u = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_n = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_store = np.zeros((3, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].dx = self.mesh.vessels[i].dx
 *                 vectorU[i].F_ = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_int_3);
      __Pyx_GIVEREF(__pyx_int_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_int_3);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 2143, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_6);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2143, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).u_store, 0);
      (__pyx_v_vectorU[__pyx_v_i]).u_store = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2144
 *                 vectorU[i].u_n = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_store = np.zeros((3, siz_i), dtype=np.float)
 *                 vectorU[i].dx = self.mesh.vessels[i].dx             # <<<<<<<<<<<<<<
 *                 vectorU[i].F_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_ = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2144, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      (__pyx_v_vectorU[__pyx_v_i]).dx = __pyx_t_12;

      /* "pylsewave/cynum.pyx":2145
 *                 vectorU[i].u_store = np.zeros((3, siz_i), dtype=np.float)
 *                 vectorU[i].dx = self.mesh.vessels[i].dx
 *                 vectorU[i].F_ = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].S_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_5);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2145, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).F_, 0);
      (__pyx_v_vectorU[__pyx_v_i]).F_ = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2146
 *                 vectorU[i].dx = self.mesh.vessels[i].dx
 *                 vectorU[i].F_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_ = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].u_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_nh_ph = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_10);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).S_, 0);
      (__pyx_v_vectorU[__pyx_v_i]).S_ = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2147
 *                 vectorU[i].F_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_nh_mh = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].u_nh_ph = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].F_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 2147, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_9);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2147, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).u_nh_mh, 0);
      (__pyx_v_vectorU[__pyx_v_i]).u_nh_mh = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2148
 *                 vectorU[i].S_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_nh_ph = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].F_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 2148, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_6);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2148, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).u_nh_ph, 0);
      (__pyx_v_vectorU[__pyx_v_i]).u_nh_ph = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2149
 *                 vectorU[i].u_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_nh_ph = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].F_nh_mh = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].S_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].F_nh_ph = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 2149, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_5);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2149, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).F_nh_mh, 0);
      (__pyx_v_vectorU[__pyx_v_i]).F_nh_mh = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2150
 *                 vectorU[i].u_nh_ph = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].F_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_nh_mh = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].F_nh_ph = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_nh_ph = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 2150, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_10);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2150, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).S_nh_mh, 0);
      (__pyx_v_vectorU[__pyx_v_i]).S_nh_mh = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2151
 *                 vectorU[i].F_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].F_nh_ph = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].S_nh_ph = np.zeros((2, siz_i), dtype=np.float)
 * 
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 2151, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_9);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2151, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).F_nh_ph, 0);
      (__pyx_v_vectorU[__pyx_v_i]).F_nh_ph = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2152
 *                 vectorU[i].S_nh_mh = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].F_nh_ph = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_nh_ph = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(self, cMacCormackSolver):
 */
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 2152, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_6);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2152, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).S_nh_ph, 0);
      (__pyx_v_vectorU[__pyx_v_i]).S_nh_ph = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;
    }

    /* "pylsewave/cynum.pyx":2137
 * 
 *     cdef void initialise_solution_vector(self, vector[U] &vectorU, int length):
 *         if isinstance(self, cLaxWendroffSolver):             # <<<<<<<<<<<<<<
 *             for i in range(length):
 *                 siz_i = self.mesh.vessels[i].x.shape[0]
 */
    goto __pyx_L3;
  }

  /* "pylsewave/cynum.pyx":2154
 *                 vectorU[i].S_nh_ph = np.zeros((2, siz_i), dtype=np.float)
 * 
 *         elif isinstance(self, cMacCormackSolver):             # <<<<<<<<<<<<<<
 *             for i in range(length):
 *                 siz_i = self.mesh.vessels[i].x.shape[0]
 */
  __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_ptype_9pylsewave_5cynum_cMacCormackSolver); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pylsewave/cynum.pyx":2155
 * 
 *         elif isinstance(self, cMacCormackSolver):
 *             for i in range(length):             # <<<<<<<<<<<<<<
 *                 siz_i = self.mesh.vessels[i].x.shape[0]
 *                 vectorU[i].x_size = siz_i
 */
    __pyx_t_3 = __pyx_v_length;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "pylsewave/cynum.pyx":2156
 *         elif isinstance(self, cMacCormackSolver):
 *             for i in range(length):
 *                 siz_i = self.mesh.vessels[i].x.shape[0]             # <<<<<<<<<<<<<<
 *                 vectorU[i].x_size = siz_i
 *                 vectorU[i].u = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_siz_i, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "pylsewave/cynum.pyx":2157
 *             for i in range(length):
 *                 siz_i = self.mesh.vessels[i].x.shape[0]
 *                 vectorU[i].x_size = siz_i             # <<<<<<<<<<<<<<
 *                 vectorU[i].u = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_n = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_siz_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2157, __pyx_L1_error)
      (__pyx_v_vectorU[__pyx_v_i]).x_size = __pyx_t_7;

      /* "pylsewave/cynum.pyx":2158
 *                 siz_i = self.mesh.vessels[i].x.shape[0]
 *                 vectorU[i].x_size = siz_i
 *                 vectorU[i].u = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].u_n = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_star = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 2158, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_5);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2158, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).u, 0);
      (__pyx_v_vectorU[__pyx_v_i]).u = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2159
 *                 vectorU[i].x_size = siz_i
 *                 vectorU[i].u = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_n = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].u_star = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_store = np.zeros((3, siz_i), dtype=np.float)
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 2159, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_10);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2159, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).u_n, 0);
      (__pyx_v_vectorU[__pyx_v_i]).u_n = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2160
 *                 vectorU[i].u = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_n = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_star = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].u_store = np.zeros((3, siz_i), dtype=np.float)
 *                 vectorU[i].dx = self.mesh.vessels[i].dx
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 2160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_9);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).u_star, 0);
      (__pyx_v_vectorU[__pyx_v_i]).u_star = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2161
 *                 vectorU[i].u_n = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_star = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_store = np.zeros((3, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].dx = self.mesh.vessels[i].dx
 *                 vectorU[i].F_ = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_int_3);
      __Pyx_GIVEREF(__pyx_int_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_int_3);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 2161, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_6);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2161, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).u_store, 0);
      (__pyx_v_vectorU[__pyx_v_i]).u_store = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2162
 *                 vectorU[i].u_star = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].u_store = np.zeros((3, siz_i), dtype=np.float)
 *                 vectorU[i].dx = self.mesh.vessels[i].dx             # <<<<<<<<<<<<<<
 *                 vectorU[i].F_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_ = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2162, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      (__pyx_v_vectorU[__pyx_v_i]).dx = __pyx_t_12;

      /* "pylsewave/cynum.pyx":2163
 *                 vectorU[i].u_store = np.zeros((3, siz_i), dtype=np.float)
 *                 vectorU[i].dx = self.mesh.vessels[i].dx
 *                 vectorU[i].F_ = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].S_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].F_star = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_5);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).F_, 0);
      (__pyx_v_vectorU[__pyx_v_i]).F_ = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2164
 *                 vectorU[i].dx = self.mesh.vessels[i].dx
 *                 vectorU[i].F_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_ = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].F_star = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_star = np.zeros((2, siz_i), dtype=np.float)
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_10);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).S_, 0);
      (__pyx_v_vectorU[__pyx_v_i]).S_ = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2165
 *                 vectorU[i].F_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].F_star = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 *                 vectorU[i].S_star = np.zeros((2, siz_i), dtype=np.float)
 * 
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 2165, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_9);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2165, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).F_star, 0);
      (__pyx_v_vectorU[__pyx_v_i]).F_star = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;

      /* "pylsewave/cynum.pyx":2166
 *                 vectorU[i].S_ = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].F_star = np.zeros((2, siz_i), dtype=np.float)
 *                 vectorU[i].S_star = np.zeros((2, siz_i), dtype=np.float)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_int_2);
      __Pyx_INCREF(__pyx_v_siz_i);
      __Pyx_GIVEREF(__pyx_v_siz_i);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_siz_i);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_6);
      if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_XDEC_MEMVIEW(&(__pyx_v_vectorU[__pyx_v_i]).S_star, 0);
      (__pyx_v_vectorU[__pyx_v_i]).S_star = __pyx_t_11;
      __pyx_t_11.memview = NULL;
      __pyx_t_11.data = NULL;
    }

    /* "pylsewave/cynum.pyx":2154
 *                 vectorU[i].S_nh_ph = np.zeros((2, siz_i), dtype=np.float)
 * 
 *         elif isinstance(self, cMacCormackSolver):             # <<<<<<<<<<<<<<
 *             for i in range(length):
 *                 siz_i = self.mesh.vessels[i].x.shape[0]
 */
  }
  __pyx_L3:;

  /* "pylsewave/cynum.pyx":2136
 *             return CFL.CFL_STATUS_ERROR
 * 
 *     cdef void initialise_solution_vector(self, vector[U] &vectorU, int length):             # <<<<<<<<<<<<<<
 *         if isinstance(self, cLaxWendroffSolver):
 *             for i in range(length):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cFDMSolver.initialise_solution_vector", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_siz_i);
  __Pyx_RefNannyFinishContext();
}

/* "pylsewave/cynum.pyx":2173
 *     @cython.initializedcheck(False)
 *     @cython.cdivision(True)
 *     cpdef SOLVER solve(self, user_action=None,             # <<<<<<<<<<<<<<
 *               version="vectorised"):
 * 
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_10cFDMSolver_7solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static enum __pyx_t_9pylsewave_5cynum_SOLVER __pyx_f_9pylsewave_5cynum_10cFDMSolver_solve(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pylsewave_5cynum_10cFDMSolver_solve *__pyx_optional_args) {
  PyObject *__pyx_v_user_action = ((PyObject *)Py_None);
  PyObject *__pyx_v_version = ((PyObject *)__pyx_n_s_vectorised);
  Py_ssize_t __pyx_v_length;
  Py_ssize_t __pyx_v_len_x;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  __Pyx_memviewslice __pyx_v_getarr = { 0, 0, { 0 }, { 0 }, { 0 } };
  enum __pyx_t_9pylsewave_5cynum_CFL __pyx_v_res_cfl;
  std::vector<struct __pyx_t_9pylsewave_5cynum_U>  __pyx_v_v_U;
  PyObject *__pyx_v_time = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_t0 = NULL;
  double __pyx_v_p;
  int __pyx_v_index;
  int __pyx_v_siz_U0;
  int __pyx_v_k;
  CYTHON_UNUSED int __pyx_v_siz_UL;
  int __pyx_v_siz_UBif;
  int __pyx_v_siz_UConj;
  int __pyx_v_par;
  int __pyx_v_d1;
  int __pyx_v_d2;
  __Pyx_memviewslice __pyx_v_u_nmp1 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_x_n = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_u_nmp1_conj = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_x_n_conj = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_last_index;
  int __pyx_v_first_index;
  CYTHON_UNUSED int __pyx_v_iter_count;
  __Pyx_memviewslice __pyx_v_bif_list = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_conj_list = { 0, 0, { 0 }, { 0 }, { 0 } };
  enum __pyx_t_9pylsewave_5cynum_SOLVER __pyx_r;
  __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;
  enum __pyx_t_9pylsewave_5cynum_SOLVER __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  double __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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_t_23;
  int __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  __Pyx_memviewslice __pyx_t_28 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  PyObject *__pyx_t_37 = NULL;
  PyObject *__pyx_t_38 = NULL;
  PyObject *__pyx_t_39 = NULL;
  PyObject *__pyx_t_40 = NULL;
  PyObject *__pyx_t_41 = NULL;
  long __pyx_t_42;
  int __pyx_t_43;
  int __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  int __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  double __pyx_t_62;
  double __pyx_t_63;
  double __pyx_t_64;
  double __pyx_t_65;
  double __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  Py_ssize_t __pyx_t_70;
  Py_ssize_t __pyx_t_71;
  Py_ssize_t __pyx_t_72;
  Py_ssize_t __pyx_t_73;
  Py_ssize_t __pyx_t_74;
  Py_ssize_t __pyx_t_75;
  Py_ssize_t __pyx_t_76;
  Py_ssize_t __pyx_t_77;
  Py_ssize_t __pyx_t_78;
  Py_ssize_t __pyx_t_79;
  Py_ssize_t __pyx_t_80;
  Py_ssize_t __pyx_t_81;
  Py_ssize_t __pyx_t_82;
  Py_ssize_t __pyx_t_83;
  Py_ssize_t __pyx_t_84;
  Py_ssize_t __pyx_t_85;
  Py_ssize_t __pyx_t_86;
  Py_ssize_t __pyx_t_87;
  Py_ssize_t __pyx_t_88;
  Py_ssize_t __pyx_t_89;
  Py_ssize_t __pyx_t_90;
  Py_ssize_t __pyx_t_91;
  Py_ssize_t __pyx_t_92;
  Py_ssize_t __pyx_t_93;
  Py_ssize_t __pyx_t_94;
  Py_ssize_t __pyx_t_95;
  Py_ssize_t __pyx_t_96;
  Py_ssize_t __pyx_t_97;
  Py_ssize_t __pyx_t_98;
  Py_ssize_t __pyx_t_99;
  Py_ssize_t __pyx_t_100;
  Py_ssize_t __pyx_t_101;
  Py_ssize_t __pyx_t_102;
  Py_ssize_t __pyx_t_103;
  Py_ssize_t __pyx_t_104;
  Py_ssize_t __pyx_t_105;
  Py_ssize_t __pyx_t_106;
  Py_ssize_t __pyx_t_107;
  Py_ssize_t __pyx_t_108;
  Py_ssize_t __pyx_t_109;
  Py_ssize_t __pyx_t_110;
  Py_ssize_t __pyx_t_111;
  Py_ssize_t __pyx_t_112;
  Py_ssize_t __pyx_t_113;
  Py_ssize_t __pyx_t_114;
  struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_bif __pyx_t_115;
  Py_ssize_t __pyx_t_116;
  Py_ssize_t __pyx_t_117;
  Py_ssize_t __pyx_t_118;
  Py_ssize_t __pyx_t_119;
  Py_ssize_t __pyx_t_120;
  Py_ssize_t __pyx_t_121;
  Py_ssize_t __pyx_t_122;
  Py_ssize_t __pyx_t_123;
  Py_ssize_t __pyx_t_124;
  Py_ssize_t __pyx_t_125;
  Py_ssize_t __pyx_t_126;
  Py_ssize_t __pyx_t_127;
  Py_ssize_t __pyx_t_128;
  Py_ssize_t __pyx_t_129;
  Py_ssize_t __pyx_t_130;
  Py_ssize_t __pyx_t_131;
  Py_ssize_t __pyx_t_132;
  Py_ssize_t __pyx_t_133;
  Py_ssize_t __pyx_t_134;
  Py_ssize_t __pyx_t_135;
  Py_ssize_t __pyx_t_136;
  Py_ssize_t __pyx_t_137;
  Py_ssize_t __pyx_t_138;
  Py_ssize_t __pyx_t_139;
  Py_ssize_t __pyx_t_140;
  Py_ssize_t __pyx_t_141;
  Py_ssize_t __pyx_t_142;
  Py_ssize_t __pyx_t_143;
  Py_ssize_t __pyx_t_144;
  Py_ssize_t __pyx_t_145;
  Py_ssize_t __pyx_t_146;
  Py_ssize_t __pyx_t_147;
  Py_ssize_t __pyx_t_148;
  Py_ssize_t __pyx_t_149;
  Py_ssize_t __pyx_t_150;
  Py_ssize_t __pyx_t_151;
  Py_ssize_t __pyx_t_152;
  Py_ssize_t __pyx_t_153;
  Py_ssize_t __pyx_t_154;
  Py_ssize_t __pyx_t_155;
  Py_ssize_t __pyx_t_156;
  Py_ssize_t __pyx_t_157;
  Py_ssize_t __pyx_t_158;
  Py_ssize_t __pyx_t_159;
  Py_ssize_t __pyx_t_160;
  Py_ssize_t __pyx_t_161;
  Py_ssize_t __pyx_t_162;
  Py_ssize_t __pyx_t_163;
  Py_ssize_t __pyx_t_164;
  Py_ssize_t __pyx_t_165;
  Py_ssize_t __pyx_t_166;
  Py_ssize_t __pyx_t_167;
  Py_ssize_t __pyx_t_168;
  Py_ssize_t __pyx_t_169;
  Py_ssize_t __pyx_t_170;
  Py_ssize_t __pyx_t_171;
  struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_conj __pyx_t_172;
  Py_ssize_t __pyx_t_173;
  Py_ssize_t __pyx_t_174;
  Py_ssize_t __pyx_t_175;
  Py_ssize_t __pyx_t_176;
  Py_ssize_t __pyx_t_177;
  Py_ssize_t __pyx_t_178;
  Py_ssize_t __pyx_t_179;
  Py_ssize_t __pyx_t_180;
  Py_ssize_t __pyx_t_181;
  Py_ssize_t __pyx_t_182;
  Py_ssize_t __pyx_t_183;
  Py_ssize_t __pyx_t_184;
  int __pyx_t_185;
  Py_ssize_t __pyx_t_186;
  Py_ssize_t __pyx_t_187;
  Py_ssize_t __pyx_t_188;
  Py_ssize_t __pyx_t_189;
  Py_ssize_t __pyx_t_190;
  Py_ssize_t __pyx_t_191;
  Py_ssize_t __pyx_t_192;
  Py_ssize_t __pyx_t_193;
  Py_ssize_t __pyx_t_194;
  Py_ssize_t __pyx_t_195;
  Py_ssize_t __pyx_t_196;
  Py_ssize_t __pyx_t_197;
  Py_ssize_t __pyx_t_198;
  Py_ssize_t __pyx_t_199;
  Py_ssize_t __pyx_t_200;
  Py_ssize_t __pyx_t_201;
  Py_ssize_t __pyx_t_202;
  Py_ssize_t __pyx_t_203;
  PyObject *__pyx_t_204 = NULL;
  Py_ssize_t __pyx_t_205;
  Py_ssize_t __pyx_t_206;
  Py_ssize_t __pyx_t_207;
  Py_ssize_t __pyx_t_208;
  Py_ssize_t __pyx_t_209;
  Py_ssize_t __pyx_t_210;
  Py_ssize_t __pyx_t_211;
  Py_ssize_t __pyx_t_212;
  Py_ssize_t __pyx_t_213;
  __Pyx_RefNannySetupContext("solve", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_user_action = __pyx_optional_args->user_action;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_version = __pyx_optional_args->version;
      }
    }
  }
  /* 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_solve); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_10cFDMSolver_7solve)) {
      __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_ERR(0, 2173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_user_action);
      __Pyx_GIVEREF(__pyx_v_user_action);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_user_action);
      __Pyx_INCREF(__pyx_v_version);
      __Pyx_GIVEREF(__pyx_v_version);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_version);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2173, __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_t_7 = ((enum __pyx_t_9pylsewave_5cynum_SOLVER)__Pyx_PyInt_As_enum____pyx_t_9pylsewave_5cynum_SOLVER(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2173, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":2177
 * 
 *         cdef Py_ssize_t length, len_x, i, j, n, i_bcs
 *         cdef double[::1] getarr = np.zeros(2, np.float)             # <<<<<<<<<<<<<<
 *         # array to store the wave speeds
 *         cdef double[::1] c_i
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_int_2);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_getarr = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2182
 *         cdef CFL res_cfl
 *         cdef SOLVER res_solver
 *         length = len(self.mesh.vessels)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t siz_i
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 2182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_length = __pyx_t_5;

  /* "pylsewave/cynum.pyx":2186
 *         cdef Py_ssize_t siz_i
 *         cdef vector[U] v_U
 *         v_U.resize(length)             # <<<<<<<<<<<<<<
 *         self.initialise_solution_vector(v_U, length)
 * 
 */
  try {
    __pyx_v_v_U.resize(__pyx_v_length);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2186, __pyx_L1_error)
  }

  /* "pylsewave/cynum.pyx":2187
 *         cdef vector[U] v_U
 *         v_U.resize(length)
 *         self.initialise_solution_vector(v_U, length)             # <<<<<<<<<<<<<<
 * 
 *         import time
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self->__pyx_vtab)->initialise_solution_vector(__pyx_v_self, __pyx_v_v_U, __pyx_v_length);

  /* "pylsewave/cynum.pyx":2189
 *         self.initialise_solution_vector(v_U, length)
 * 
 *         import time             # <<<<<<<<<<<<<<
 *         t0 = time.clock()  # CPU time measurement
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_time = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":2190
 * 
 *         import time
 *         t0 = time.clock()  # CPU time measurement             # <<<<<<<<<<<<<<
 * 
 *         # --- Valid indices for space and time mesh ---
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_clock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2190, __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2190, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2190, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_t0 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":2194
 *         # --- Valid indices for space and time mesh ---
 *         # self._Ix = range(0, self._Nx + 1)
 *         self._It = np.arange(0, self._Nt + 1, dtype=np.int)             # <<<<<<<<<<<<<<
 * 
 *         self._dt = self._t[1] - self._t[0]
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->_Nt + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_2);
  if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_It, 0);
  __pyx_v_self->_It = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "pylsewave/cynum.pyx":2196
 *         self._It = np.arange(0, self._Nt + 1, dtype=np.int)
 * 
 *         self._dt = self._t[1] - self._t[0]             # <<<<<<<<<<<<<<
 * 
 *         print("Solver set to dt=%0.9f" % self._dt)
 */
  __pyx_t_10 = 1;
  __pyx_t_11 = 0;
  __pyx_v_self->_dt = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_t.data) + __pyx_t_10)) ))) - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_t.data) + __pyx_t_11)) ))));

  /* "pylsewave/cynum.pyx":2198
 *         self._dt = self._t[1] - self._t[0]
 * 
 *         print("Solver set to dt=%0.9f" % self._dt)             # <<<<<<<<<<<<<<
 * 
 *         # check with nogil here
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_dt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Solver_set_to_dt_0_9f, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PrintOne(0, __pyx_t_1) < 0) __PYX_ERR(0, 2198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":2201
 * 
 *         # check with nogil here
 *         for i in range(length):             # <<<<<<<<<<<<<<
 *             len_x = self.mesh.vessels[i].x.shape[0]
 *             for j in range(len_x):
 */
  __pyx_t_5 = __pyx_v_length;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_5; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pylsewave/cynum.pyx":2202
 *         # check with nogil here
 *         for i in range(length):
 *             len_x = self.mesh.vessels[i].x.shape[0]             # <<<<<<<<<<<<<<
 *             for j in range(len_x):
 *                 self._bcs.I(self.mesh.vessels[i].x[j], j, i, getarr)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2202, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_len_x = __pyx_t_13;

    /* "pylsewave/cynum.pyx":2203
 *         for i in range(length):
 *             len_x = self.mesh.vessels[i].x.shape[0]
 *             for j in range(len_x):             # <<<<<<<<<<<<<<
 *                 self._bcs.I(self.mesh.vessels[i].x[j], j, i, getarr)
 *                 v_U[i].u_n[0, j] = getarr[0]
 */
    __pyx_t_13 = __pyx_v_len_x;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_j = __pyx_t_14;

      /* "pylsewave/cynum.pyx":2204
 *             len_x = self.mesh.vessels[i].x.shape[0]
 *             for j in range(len_x):
 *                 self._bcs.I(self.mesh.vessels[i].x[j], j, i, getarr)             # <<<<<<<<<<<<<<
 *                 v_U[i].u_n[0, j] = getarr[0]
 *                 v_U[i].u_n[1, j] = getarr[1]
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2204, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_self->_bcs->__pyx_vtab)->I(__pyx_v_self->_bcs, __pyx_t_15, __pyx_v_j, __pyx_v_i, __pyx_v_getarr, 0);

      /* "pylsewave/cynum.pyx":2205
 *             for j in range(len_x):
 *                 self._bcs.I(self.mesh.vessels[i].x[j], j, i, getarr)
 *                 v_U[i].u_n[0, j] = getarr[0]             # <<<<<<<<<<<<<<
 *                 v_U[i].u_n[1, j] = getarr[1]
 * 
 */
      __pyx_t_16 = 0;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_18 = 0;
      __pyx_t_19 = __pyx_v_j;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_18 * __pyx_t_17.strides[0]) )) + __pyx_t_19)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_getarr.data) + __pyx_t_16)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2206
 *                 self._bcs.I(self.mesh.vessels[i].x[j], j, i, getarr)
 *                 v_U[i].u_n[0, j] = getarr[0]
 *                 v_U[i].u_n[1, j] = getarr[1]             # <<<<<<<<<<<<<<
 * 
 *                 # check cfl condition
 */
      __pyx_t_20 = 1;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_21 = 1;
      __pyx_t_22 = __pyx_v_j;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_21 * __pyx_t_17.strides[0]) )) + __pyx_t_22)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_getarr.data) + __pyx_t_20)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2209
 * 
 *                 # check cfl condition
 *                 res_cfl = self.cfl_i(getarr, v_U[i].dx, self._dt, j, i)             # <<<<<<<<<<<<<<
 *                 if res_cfl == CFL.CFL_STATUS_ERROR:
 *                     return SOLVER.SOLVER_STATUS_ERROR
 */
      __pyx_v_res_cfl = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self->__pyx_vtab)->cfl_i(__pyx_v_self, __pyx_v_getarr, (__pyx_v_v_U[__pyx_v_i]).dx, __pyx_v_self->_dt, __pyx_v_j, __pyx_v_i);

      /* "pylsewave/cynum.pyx":2210
 *                 # check cfl condition
 *                 res_cfl = self.cfl_i(getarr, v_U[i].dx, self._dt, j, i)
 *                 if res_cfl == CFL.CFL_STATUS_ERROR:             # <<<<<<<<<<<<<<
 *                     return SOLVER.SOLVER_STATUS_ERROR
 * 
 */
      __pyx_t_23 = ((__pyx_v_res_cfl == __pyx_e_9pylsewave_5cynum_CFL_STATUS_ERROR) != 0);
      if (__pyx_t_23) {

        /* "pylsewave/cynum.pyx":2211
 *                 res_cfl = self.cfl_i(getarr, v_U[i].dx, self._dt, j, i)
 *                 if res_cfl == CFL.CFL_STATUS_ERROR:
 *                     return SOLVER.SOLVER_STATUS_ERROR             # <<<<<<<<<<<<<<
 * 
 *                 if user_action is not None:
 */
        __pyx_r = __pyx_e_9pylsewave_5cynum_SOLVER_STATUS_ERROR;
        goto __pyx_L0;

        /* "pylsewave/cynum.pyx":2210
 *                 # check cfl condition
 *                 res_cfl = self.cfl_i(getarr, v_U[i].dx, self._dt, j, i)
 *                 if res_cfl == CFL.CFL_STATUS_ERROR:             # <<<<<<<<<<<<<<
 *                     return SOLVER.SOLVER_STATUS_ERROR
 * 
 */
      }

      /* "pylsewave/cynum.pyx":2213
 *                     return SOLVER.SOLVER_STATUS_ERROR
 * 
 *                 if user_action is not None:             # <<<<<<<<<<<<<<
 *                     p = self._pdes.pressure_i(getarr[0], j, vessel_index=i)
 * 
 */
      __pyx_t_23 = (__pyx_v_user_action != Py_None);
      __pyx_t_24 = (__pyx_t_23 != 0);
      if (__pyx_t_24) {

        /* "pylsewave/cynum.pyx":2214
 * 
 *                 if user_action is not None:
 *                     p = self._pdes.pressure_i(getarr[0], j, vessel_index=i)             # <<<<<<<<<<<<<<
 * 
 *                     v_U[i].u_store[0, j] = v_U[i].u_n[0, j]
 */
        __pyx_t_25 = 0;
        __pyx_v_p = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->pressure_i(__pyx_v_self->_pdes, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_getarr.data) + __pyx_t_25)) ))), __pyx_v_j, __pyx_v_i);

        /* "pylsewave/cynum.pyx":2216
 *                     p = self._pdes.pressure_i(getarr[0], j, vessel_index=i)
 * 
 *                     v_U[i].u_store[0, j] = v_U[i].u_n[0, j]             # <<<<<<<<<<<<<<
 *                     v_U[i].u_store[1, j] = v_U[i].u_n[1, j]
 *                     v_U[i].u_store[2, j] = p
 */
        __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u_n;
        __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
        __pyx_t_26 = 0;
        __pyx_t_27 = __pyx_v_j;
        __pyx_t_28 = (__pyx_v_v_U[__pyx_v_i]).u_store;
        __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
        __pyx_t_29 = 0;
        __pyx_t_30 = __pyx_v_j;
        *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_28.data + __pyx_t_29 * __pyx_t_28.strides[0]) )) + __pyx_t_30)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_26 * __pyx_t_17.strides[0]) )) + __pyx_t_27)) )));
        __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
        __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

        /* "pylsewave/cynum.pyx":2217
 * 
 *                     v_U[i].u_store[0, j] = v_U[i].u_n[0, j]
 *                     v_U[i].u_store[1, j] = v_U[i].u_n[1, j]             # <<<<<<<<<<<<<<
 *                     v_U[i].u_store[2, j] = p
 * 
 */
        __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u_n;
        __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
        __pyx_t_31 = 1;
        __pyx_t_32 = __pyx_v_j;
        __pyx_t_28 = (__pyx_v_v_U[__pyx_v_i]).u_store;
        __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
        __pyx_t_33 = 1;
        __pyx_t_34 = __pyx_v_j;
        *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_28.data + __pyx_t_33 * __pyx_t_28.strides[0]) )) + __pyx_t_34)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_31 * __pyx_t_17.strides[0]) )) + __pyx_t_32)) )));
        __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
        __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

        /* "pylsewave/cynum.pyx":2218
 *                     v_U[i].u_store[0, j] = v_U[i].u_n[0, j]
 *                     v_U[i].u_store[1, j] = v_U[i].u_n[1, j]
 *                     v_U[i].u_store[2, j] = p             # <<<<<<<<<<<<<<
 * 
 *             if user_action is not None:
 */
        __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u_store;
        __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
        __pyx_t_35 = 2;
        __pyx_t_36 = __pyx_v_j;
        *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_35 * __pyx_t_17.strides[0]) )) + __pyx_t_36)) )) = __pyx_v_p;
        __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

        /* "pylsewave/cynum.pyx":2213
 *                     return SOLVER.SOLVER_STATUS_ERROR
 * 
 *                 if user_action is not None:             # <<<<<<<<<<<<<<
 *                     p = self._pdes.pressure_i(getarr[0], j, vessel_index=i)
 * 
 */
      }
    }

    /* "pylsewave/cynum.pyx":2220
 *                     v_U[i].u_store[2, j] = p
 * 
 *             if user_action is not None:             # <<<<<<<<<<<<<<
 *                 user_action(v_U[i].u_store, self.mesh.vessels[i].x, self._t, 0, PRINT_STATUS, WRITE_STATUS, i)
 *                 # cwrite2file("./run_cases/.tmpdata__u_%010d__vessel_%03d.dat" % (0, i), v_U[i].u_store)
 */
    __pyx_t_24 = (__pyx_v_user_action != Py_None);
    __pyx_t_23 = (__pyx_t_24 != 0);
    if (__pyx_t_23) {

      /* "pylsewave/cynum.pyx":2221
 * 
 *             if user_action is not None:
 *                 user_action(v_U[i].u_store, self.mesh.vessels[i].x, self._t, 0, PRINT_STATUS, WRITE_STATUS, i)             # <<<<<<<<<<<<<<
 *                 # cwrite2file("./run_cases/.tmpdata__u_%010d__vessel_%03d.dat" % (0, i), v_U[i].u_store)
 *                 # cwrite2file("./run_cases/.tmpdata__t.dat", np.reshape(self._t, (1, self._t.shape[0])))
 */
      __pyx_t_1 = __pyx_memoryview_fromslice((__pyx_v_v_U[__pyx_v_i]).u_store, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->_t, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_PRINT_STATUS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_WRITE_STATUS); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_37);
      __pyx_t_38 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_38);
      __Pyx_INCREF(__pyx_v_user_action);
      __pyx_t_39 = __pyx_v_user_action; __pyx_t_40 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_39))) {
        __pyx_t_40 = PyMethod_GET_SELF(__pyx_t_39);
        if (likely(__pyx_t_40)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_39);
          __Pyx_INCREF(__pyx_t_40);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_39, function);
          __pyx_t_13 = 1;
        }
      }
      __pyx_t_41 = PyTuple_New(7+__pyx_t_13); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_41);
      if (__pyx_t_40) {
        __Pyx_GIVEREF(__pyx_t_40); PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_t_40); __pyx_t_40 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_41, 0+__pyx_t_13, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_41, 1+__pyx_t_13, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_41, 2+__pyx_t_13, __pyx_t_3);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_41, 3+__pyx_t_13, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_41, 4+__pyx_t_13, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_37);
      PyTuple_SET_ITEM(__pyx_t_41, 5+__pyx_t_13, __pyx_t_37);
      __Pyx_GIVEREF(__pyx_t_38);
      PyTuple_SET_ITEM(__pyx_t_41, 6+__pyx_t_13, __pyx_t_38);
      __pyx_t_1 = 0;
      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_t_6 = 0;
      __pyx_t_37 = 0;
      __pyx_t_38 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_39, __pyx_t_41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
      __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pylsewave/cynum.pyx":2220
 *                     v_U[i].u_store[2, j] = p
 * 
 *             if user_action is not None:             # <<<<<<<<<<<<<<
 *                 user_action(v_U[i].u_store, self.mesh.vessels[i].x, self._t, 0, PRINT_STATUS, WRITE_STATUS, i)
 *                 # cwrite2file("./run_cases/.tmpdata__u_%010d__vessel_%03d.dat" % (0, i), v_U[i].u_store)
 */
    }
  }

  /* "pylsewave/cynum.pyx":2231
 *         cdef int index, siz_U0, k, siz_UL, siz_UBif, siz_UConj, par, d1, d2
 *         cdef double[::1] u_nmp1, x_n, u_nmp1_conj, x_n_conj
 *         u_nmp1 = np.zeros(6, np.float)             # <<<<<<<<<<<<<<
 *         x_n = np.zeros(6, np.float)
 *         u_nmp1_conj = np.zeros(4, np.float)
 */
  __pyx_t_39 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_39, __pyx_n_s_zeros); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __pyx_t_39 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_39, __pyx_n_s_float); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __pyx_t_39 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_41))) {
    __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_41);
    if (likely(__pyx_t_39)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_41);
      __Pyx_INCREF(__pyx_t_39);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_41, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_37 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (__pyx_t_39) {
    __Pyx_GIVEREF(__pyx_t_39); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_39); __pyx_t_39 = NULL;
  }
  __Pyx_INCREF(__pyx_int_6);
  __Pyx_GIVEREF(__pyx_int_6);
  PyTuple_SET_ITEM(__pyx_t_37, 0+__pyx_t_5, __pyx_int_6);
  __Pyx_GIVEREF(__pyx_t_38);
  PyTuple_SET_ITEM(__pyx_t_37, 1+__pyx_t_5, __pyx_t_38);
  __pyx_t_38 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_41, __pyx_t_37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_u_nmp1 = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2232
 *         cdef double[::1] u_nmp1, x_n, u_nmp1_conj, x_n_conj
 *         u_nmp1 = np.zeros(6, np.float)
 *         x_n = np.zeros(6, np.float)             # <<<<<<<<<<<<<<
 *         u_nmp1_conj = np.zeros(4, np.float)
 *         x_n_conj = np.zeros(4, np.float)
 */
  __pyx_t_41 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_zeros); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_float); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_37))) {
    __pyx_t_41 = PyMethod_GET_SELF(__pyx_t_37);
    if (likely(__pyx_t_41)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37);
      __Pyx_INCREF(__pyx_t_41);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_37, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_39 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  if (__pyx_t_41) {
    __Pyx_GIVEREF(__pyx_t_41); PyTuple_SET_ITEM(__pyx_t_39, 0, __pyx_t_41); __pyx_t_41 = NULL;
  }
  __Pyx_INCREF(__pyx_int_6);
  __Pyx_GIVEREF(__pyx_int_6);
  PyTuple_SET_ITEM(__pyx_t_39, 0+__pyx_t_5, __pyx_int_6);
  __Pyx_GIVEREF(__pyx_t_38);
  PyTuple_SET_ITEM(__pyx_t_39, 1+__pyx_t_5, __pyx_t_38);
  __pyx_t_38 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_37, __pyx_t_39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_x_n = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2233
 *         u_nmp1 = np.zeros(6, np.float)
 *         x_n = np.zeros(6, np.float)
 *         u_nmp1_conj = np.zeros(4, np.float)             # <<<<<<<<<<<<<<
 *         x_n_conj = np.zeros(4, np.float)
 *         cdef int last_index, first_index, iter_count
 */
  __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_39 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_zeros); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_float); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_39))) {
    __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_39);
    if (likely(__pyx_t_37)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_39);
      __Pyx_INCREF(__pyx_t_37);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_39, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_41 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (__pyx_t_37) {
    __Pyx_GIVEREF(__pyx_t_37); PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_t_37); __pyx_t_37 = NULL;
  }
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyTuple_SET_ITEM(__pyx_t_41, 0+__pyx_t_5, __pyx_int_4);
  __Pyx_GIVEREF(__pyx_t_38);
  PyTuple_SET_ITEM(__pyx_t_41, 1+__pyx_t_5, __pyx_t_38);
  __pyx_t_38 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_39, __pyx_t_41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_u_nmp1_conj = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2234
 *         x_n = np.zeros(6, np.float)
 *         u_nmp1_conj = np.zeros(4, np.float)
 *         x_n_conj = np.zeros(4, np.float)             # <<<<<<<<<<<<<<
 *         cdef int last_index, first_index, iter_count
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)
 */
  __pyx_t_39 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_39, __pyx_n_s_zeros); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __pyx_t_39 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_39, __pyx_n_s_float); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __pyx_t_39 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_41))) {
    __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_41);
    if (likely(__pyx_t_39)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_41);
      __Pyx_INCREF(__pyx_t_39);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_41, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_37 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (__pyx_t_39) {
    __Pyx_GIVEREF(__pyx_t_39); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_39); __pyx_t_39 = NULL;
  }
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyTuple_SET_ITEM(__pyx_t_37, 0+__pyx_t_5, __pyx_int_4);
  __Pyx_GIVEREF(__pyx_t_38);
  PyTuple_SET_ITEM(__pyx_t_37, 1+__pyx_t_5, __pyx_t_38);
  __pyx_t_38 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_41, __pyx_t_37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_x_n_conj = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2236
 *         x_n_conj = np.zeros(4, np.float)
 *         cdef int last_index, first_index, iter_count
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)             # <<<<<<<<<<<<<<
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)
 *         siz_U0 = self.U0_arr.shape[0]
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_int); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_38) < 0) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
  __pyx_t_38 = __Pyx_PyObject_Call(__pyx_t_41, __pyx_tuple__12, __pyx_t_2); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_38);
  if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
  __pyx_v_bif_list = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "pylsewave/cynum.pyx":2237
 *         cdef int last_index, first_index, iter_count
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)             # <<<<<<<<<<<<<<
 *         siz_U0 = self.U0_arr.shape[0]
 *         siz_UL = self.UL_arr.shape[0]
 */
  __pyx_t_38 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
  __pyx_t_38 = PyDict_New(); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __pyx_t_41 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_int); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_t_38, __pyx_n_s_dtype, __pyx_t_37) < 0) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__13, __pyx_t_38); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_37);
  if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_v_conj_list = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "pylsewave/cynum.pyx":2238
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)
 *         siz_U0 = self.U0_arr.shape[0]             # <<<<<<<<<<<<<<
 *         siz_UL = self.UL_arr.shape[0]
 *         siz_UBif = self.UBif_arr.shape[0]
 */
  __pyx_v_siz_U0 = (__pyx_v_self->U0_arr.shape[0]);

  /* "pylsewave/cynum.pyx":2239
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)
 *         siz_U0 = self.U0_arr.shape[0]
 *         siz_UL = self.UL_arr.shape[0]             # <<<<<<<<<<<<<<
 *         siz_UBif = self.UBif_arr.shape[0]
 *         siz_UConj = self.UConj_arr.shape[0]
 */
  __pyx_v_siz_UL = (__pyx_v_self->UL_arr.shape[0]);

  /* "pylsewave/cynum.pyx":2240
 *         siz_U0 = self.U0_arr.shape[0]
 *         siz_UL = self.UL_arr.shape[0]
 *         siz_UBif = self.UBif_arr.shape[0]             # <<<<<<<<<<<<<<
 *         siz_UConj = self.UConj_arr.shape[0]
 * 
 */
  __pyx_v_siz_UBif = (__pyx_v_self->UBif_arr.shape[0]);

  /* "pylsewave/cynum.pyx":2241
 *         siz_UL = self.UL_arr.shape[0]
 *         siz_UBif = self.UBif_arr.shape[0]
 *         siz_UConj = self.UConj_arr.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         #range [1 , self._Nt + 1]
 */
  __pyx_v_siz_UConj = (__pyx_v_self->UConj_arr.shape[0]);

  /* "pylsewave/cynum.pyx":2244
 * 
 *         #range [1 , self._Nt + 1]
 *         for n in range(1, self._Nt + 1):             # <<<<<<<<<<<<<<
 *             # this needs to be parallel
 *             # with nogil, parallel(num_threads=8):
 */
  __pyx_t_42 = (__pyx_v_self->_Nt + 1);
  for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_42; __pyx_t_5+=1) {
    __pyx_v_n = __pyx_t_5;

    /* "pylsewave/cynum.pyx":2247
 *             # this needs to be parallel
 *             # with nogil, parallel(num_threads=8):
 *             for i in prange(length, nogil=True):             # <<<<<<<<<<<<<<
 *             # for i in range(length):
 *                 self.advance(v_U[i], self._dt, v_U[i].dx, i)
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {
          __pyx_t_12 = __pyx_v_length;
          if (1 == 0) abort();
          {
              #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                  #undef likely
                  #undef unlikely
                  #define likely(x)   (x)
                  #define unlikely(x) (x)
              #endif
              __pyx_t_14 = (__pyx_t_12 - 0 + 1 - 1/abs(1)) / 1;
              if (__pyx_t_14 > 0)
              {
                  #ifdef _OPENMP
                  #pragma omp parallel
                  #endif /* _OPENMP */
                  {
                      #ifdef _OPENMP
                      #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i)
                      #endif /* _OPENMP */
                      for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13++){
                          {
                              __pyx_v_i = (Py_ssize_t)(0 + 1 * __pyx_t_13);

                              /* "pylsewave/cynum.pyx":2249
 *             for i in prange(length, nogil=True):
 *             # for i in range(length):
 *                 self.advance(v_U[i], self._dt, v_U[i].dx, i)             # <<<<<<<<<<<<<<
 * 
 * #             # Insert boundary conditions
 */
                              ((struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self->__pyx_vtab)->advance(__pyx_v_self, (__pyx_v_v_U[__pyx_v_i]), __pyx_v_self->_dt, (__pyx_v_v_U[__pyx_v_i]).dx, __pyx_v_i);
                          }
                      }
                  }
              }
          }
          #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
              #undef likely
              #undef unlikely
              #define likely(x)   __builtin_expect(!!(x), 1)
              #define unlikely(x) __builtin_expect(!!(x), 0)
          #endif
        }

        /* "pylsewave/cynum.pyx":2247
 *             # this needs to be parallel
 *             # with nogil, parallel(num_threads=8):
 *             for i in prange(length, nogil=True):             # <<<<<<<<<<<<<<
 *             # for i in range(length):
 *                 self.advance(v_U[i], self._dt, v_U[i].dx, i)
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L16;
          }
          __pyx_L16:;
        }
    }

    /* "pylsewave/cynum.pyx":2253
 * #             # Insert boundary conditions
 * #             i_bcs = 0# self._Ix[0]
 *             for index in range(siz_U0):             # <<<<<<<<<<<<<<
 *                 k = self.U0_arr[index]
 *                 self._bcs.U_0(v_U[k].u_n, self._t[n], v_U[k].dx, self._dt, k, v_U[k].u)
 */
    __pyx_t_43 = __pyx_v_siz_U0;
    for (__pyx_t_44 = 0; __pyx_t_44 < __pyx_t_43; __pyx_t_44+=1) {
      __pyx_v_index = __pyx_t_44;

      /* "pylsewave/cynum.pyx":2254
 * #             i_bcs = 0# self._Ix[0]
 *             for index in range(siz_U0):
 *                 k = self.U0_arr[index]             # <<<<<<<<<<<<<<
 *                 self._bcs.U_0(v_U[k].u_n, self._t[n], v_U[k].dx, self._dt, k, v_U[k].u)
 * 
 */
      __pyx_t_45 = __pyx_v_index;
      __pyx_v_k = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->U0_arr.data) + __pyx_t_45)) )));

      /* "pylsewave/cynum.pyx":2255
 *             for index in range(siz_U0):
 *                 k = self.U0_arr[index]
 *                 self._bcs.U_0(v_U[k].u_n, self._t[n], v_U[k].dx, self._dt, k, v_U[k].u)             # <<<<<<<<<<<<<<
 * 
 *             # with nogil, parallel(num_threads=8):
 */
      __pyx_t_46 = __pyx_v_n;
      ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_self->_bcs->__pyx_vtab)->U_0(__pyx_v_self->_bcs, (__pyx_v_v_U[__pyx_v_k]).u_n, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_t.data) + __pyx_t_46)) ))), (__pyx_v_v_U[__pyx_v_k]).dx, __pyx_v_self->_dt, __pyx_v_k, (__pyx_v_v_U[__pyx_v_k]).u, 0);
    }

    /* "pylsewave/cynum.pyx":2258
 * 
 *             # with nogil, parallel(num_threads=8):
 *             for index in prange(siz_UL, nogil=True):             # <<<<<<<<<<<<<<
 *             # for index in range(siz_UL):
 *             #         k = self.UL_arr[index]
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {
          __pyx_t_43 = __pyx_v_siz_UL;
          if (1 == 0) abort();
          {
              int __pyx_parallel_temp0 = 0xbad0bad0;
              const char *__pyx_parallel_filename = NULL; int __pyx_parallel_lineno = 0, __pyx_parallel_clineno = 0;
              PyObject *__pyx_parallel_exc_type = NULL, *__pyx_parallel_exc_value = NULL, *__pyx_parallel_exc_tb = NULL;
              int __pyx_parallel_why;
              __pyx_parallel_why = 0;
              #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                  #undef likely
                  #undef unlikely
                  #define likely(x)   (x)
                  #define unlikely(x) (x)
              #endif
              __pyx_t_47 = (__pyx_t_43 - 0 + 1 - 1/abs(1)) / 1;
              if (__pyx_t_47 > 0)
              {
                  #ifdef _OPENMP
                  #pragma omp parallel private(__pyx_t_48, __pyx_t_49, __pyx_t_50, __pyx_t_51, __pyx_t_52) private(__pyx_filename, __pyx_lineno, __pyx_clineno) shared(__pyx_parallel_why, __pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb)
                  #endif /* _OPENMP */
                  {
                      #ifdef _OPENMP
                      #ifdef WITH_THREAD
                      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                      #endif
                      Py_BEGIN_ALLOW_THREADS
                      #endif /* _OPENMP */
                      #ifdef _OPENMP
                      #pragma omp for firstprivate(__pyx_v_index) lastprivate(__pyx_v_index)
                      #endif /* _OPENMP */
                      for (__pyx_t_44 = 0; __pyx_t_44 < __pyx_t_47; __pyx_t_44++){
                          if (__pyx_parallel_why < 2)
                          {
                              __pyx_v_index = (int)(0 + 1 * __pyx_t_44);

                              /* "pylsewave/cynum.pyx":2261
 *             # for index in range(siz_UL):
 *             #         k = self.UL_arr[index]
 *                 self._bcs.U_L(v_U[self.UL_arr[index]].u_n, self._t[n], v_U[self.UL_arr[index]].dx,             # <<<<<<<<<<<<<<
 *                               self._dt, self.UL_arr[index], v_U[self.UL_arr[index]].u)
 * 
 */
                              __pyx_t_48 = __pyx_v_index;
                              __pyx_t_49 = __pyx_v_n;
                              __pyx_t_50 = __pyx_v_index;

                              /* "pylsewave/cynum.pyx":2262
 *             #         k = self.UL_arr[index]
 *                 self._bcs.U_L(v_U[self.UL_arr[index]].u_n, self._t[n], v_U[self.UL_arr[index]].dx,
 *                               self._dt, self.UL_arr[index], v_U[self.UL_arr[index]].u)             # <<<<<<<<<<<<<<
 * 
 *             #parallel siz_UBif
 */
                              __pyx_t_51 = __pyx_v_index;
                              __pyx_t_52 = __pyx_v_index;

                              /* "pylsewave/cynum.pyx":2261
 *             # for index in range(siz_UL):
 *             #         k = self.UL_arr[index]
 *                 self._bcs.U_L(v_U[self.UL_arr[index]].u_n, self._t[n], v_U[self.UL_arr[index]].dx,             # <<<<<<<<<<<<<<
 *                               self._dt, self.UL_arr[index], v_U[self.UL_arr[index]].u)
 * 
 */
                              ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_self->_bcs->__pyx_vtab)->U_L(__pyx_v_self->_bcs, (__pyx_v_v_U[(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->UL_arr.data) + __pyx_t_48)) )))]).u_n, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_t.data) + __pyx_t_49)) ))), (__pyx_v_v_U[(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->UL_arr.data) + __pyx_t_50)) )))]).dx, __pyx_v_self->_dt, (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->UL_arr.data) + __pyx_t_51)) ))), (__pyx_v_v_U[(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->UL_arr.data) + __pyx_t_52)) )))]).u); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2261, __pyx_L32_error)
                              goto __pyx_L35;
                              __pyx_L32_error:;
                              {
                                  #ifdef WITH_THREAD
                                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                                  #endif
                                  #ifdef _OPENMP
                                  #pragma omp flush(__pyx_parallel_exc_type)
                                  #endif /* _OPENMP */
                                  if (!__pyx_parallel_exc_type) {
                                    __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
                                    __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
                                    __Pyx_GOTREF(__pyx_parallel_exc_type);
                                  }
                                  #ifdef WITH_THREAD
                                  PyGILState_Release(__pyx_gilstate_save);
                                  #endif
                              }
                              __pyx_parallel_why = 4;
                              goto __pyx_L34;
                              __pyx_L34:;
                              #ifdef _OPENMP
                              #pragma omp critical(__pyx_parallel_lastprivates0)
                              #endif /* _OPENMP */
                              {
                                  __pyx_parallel_temp0 = __pyx_v_index;
                              }
                              __pyx_L35:;
                              #ifdef _OPENMP
                              #pragma omp flush(__pyx_parallel_why)
                              #endif /* _OPENMP */
                          }
                      }
                      #ifdef _OPENMP
                      Py_END_ALLOW_THREADS
                      #else
{
#ifdef WITH_THREAD
                      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                      #endif
                      #endif /* _OPENMP */
                      /* Clean up any temporaries */
                      #ifdef WITH_THREAD
                      PyGILState_Release(__pyx_gilstate_save);
                      #endif
                      #ifndef _OPENMP
}
#endif /* _OPENMP */
                  }
              }
              if (__pyx_parallel_exc_type) {
                /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
                __pyx_parallel_why = 4;
              }
              if (__pyx_parallel_why) {
                __pyx_v_index = __pyx_parallel_temp0;
                switch (__pyx_parallel_why) {
                      case 4:
                  {
                      #ifdef WITH_THREAD
                      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                      #endif
                      __Pyx_GIVEREF(__pyx_parallel_exc_type);
                      __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
                      __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
                      #ifdef WITH_THREAD
                      PyGILState_Release(__pyx_gilstate_save);
                      #endif
                  }
                  goto __pyx_L28_error;
                }
              }
          }
          #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
              #undef likely
              #undef unlikely
              #define likely(x)   __builtin_expect(!!(x), 1)
              #define unlikely(x) __builtin_expect(!!(x), 0)
          #endif
        }

        /* "pylsewave/cynum.pyx":2258
 * 
 *             # with nogil, parallel(num_threads=8):
 *             for index in prange(siz_UL, nogil=True):             # <<<<<<<<<<<<<<
 *             # for index in range(siz_UL):
 *             #         k = self.UL_arr[index]
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L29;
          }
          __pyx_L28_error: {
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L29:;
        }
    }

    /* "pylsewave/cynum.pyx":2265
 * 
 *             #parallel siz_UBif
 *             for index in range(siz_UBif):             # <<<<<<<<<<<<<<
 *             # for index in prange(siz_UBif, nogil=True):
 *                 par = self.UBif_arr[index, 0]
 */
    __pyx_t_47 = __pyx_v_siz_UBif;
    for (__pyx_t_44 = 0; __pyx_t_44 < __pyx_t_47; __pyx_t_44+=1) {
      __pyx_v_index = __pyx_t_44;

      /* "pylsewave/cynum.pyx":2267
 *             for index in range(siz_UBif):
 *             # for index in prange(siz_UBif, nogil=True):
 *                 par = self.UBif_arr[index, 0]             # <<<<<<<<<<<<<<
 *                 d1 = self.UBif_arr[index, 1]
 *                 d2 = self.UBif_arr[index, 2]
 */
      __pyx_t_53 = __pyx_v_index;
      __pyx_t_54 = 0;
      __pyx_v_par = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->UBif_arr.data + __pyx_t_53 * __pyx_v_self->UBif_arr.strides[0]) )) + __pyx_t_54)) )));

      /* "pylsewave/cynum.pyx":2268
 *             # for index in prange(siz_UBif, nogil=True):
 *                 par = self.UBif_arr[index, 0]
 *                 d1 = self.UBif_arr[index, 1]             # <<<<<<<<<<<<<<
 *                 d2 = self.UBif_arr[index, 2]
 *                 bif_list[0] = par
 */
      __pyx_t_55 = __pyx_v_index;
      __pyx_t_56 = 1;
      __pyx_v_d1 = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->UBif_arr.data + __pyx_t_55 * __pyx_v_self->UBif_arr.strides[0]) )) + __pyx_t_56)) )));

      /* "pylsewave/cynum.pyx":2269
 *                 par = self.UBif_arr[index, 0]
 *                 d1 = self.UBif_arr[index, 1]
 *                 d2 = self.UBif_arr[index, 2]             # <<<<<<<<<<<<<<
 *                 bif_list[0] = par
 *                 bif_list[1] = d1
 */
      __pyx_t_57 = __pyx_v_index;
      __pyx_t_58 = 2;
      __pyx_v_d2 = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->UBif_arr.data + __pyx_t_57 * __pyx_v_self->UBif_arr.strides[0]) )) + __pyx_t_58)) )));

      /* "pylsewave/cynum.pyx":2270
 *                 d1 = self.UBif_arr[index, 1]
 *                 d2 = self.UBif_arr[index, 2]
 *                 bif_list[0] = par             # <<<<<<<<<<<<<<
 *                 bif_list[1] = d1
 *                 bif_list[2] = d2
 */
      __pyx_t_59 = 0;
      *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_bif_list.data) + __pyx_t_59)) )) = __pyx_v_par;

      /* "pylsewave/cynum.pyx":2271
 *                 d2 = self.UBif_arr[index, 2]
 *                 bif_list[0] = par
 *                 bif_list[1] = d1             # <<<<<<<<<<<<<<
 *                 bif_list[2] = d2
 *                 u_nmp1[0], u_nmp1[1], u_nmp1[2], u_nmp1[3], u_nmp1[4], u_nmp1[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 */
      __pyx_t_60 = 1;
      *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_bif_list.data) + __pyx_t_60)) )) = __pyx_v_d1;

      /* "pylsewave/cynum.pyx":2272
 *                 bif_list[0] = par
 *                 bif_list[1] = d1
 *                 bif_list[2] = d2             # <<<<<<<<<<<<<<
 *                 u_nmp1[0], u_nmp1[1], u_nmp1[2], u_nmp1[3], u_nmp1[4], u_nmp1[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 x_n[0], x_n[1], x_n[2], x_n[3], x_n[4], x_n[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 */
      __pyx_t_61 = 2;
      *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_bif_list.data) + __pyx_t_61)) )) = __pyx_v_d2;

      /* "pylsewave/cynum.pyx":2273
 *                 bif_list[1] = d1
 *                 bif_list[2] = d2
 *                 u_nmp1[0], u_nmp1[1], u_nmp1[2], u_nmp1[3], u_nmp1[4], u_nmp1[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0             # <<<<<<<<<<<<<<
 *                 x_n[0], x_n[1], x_n[2], x_n[3], x_n[4], x_n[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[par].u.shape[1]
 */
      __pyx_t_15 = 0.0;
      __pyx_t_62 = 0.0;
      __pyx_t_63 = 0.0;
      __pyx_t_64 = 0.0;
      __pyx_t_65 = 0.0;
      __pyx_t_66 = 0.0;
      __pyx_t_67 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_67)) )) = __pyx_t_15;
      __pyx_t_68 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_68)) )) = __pyx_t_62;
      __pyx_t_69 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_69)) )) = __pyx_t_63;
      __pyx_t_70 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_70)) )) = __pyx_t_64;
      __pyx_t_71 = 4;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_71)) )) = __pyx_t_65;
      __pyx_t_72 = 5;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_72)) )) = __pyx_t_66;

      /* "pylsewave/cynum.pyx":2274
 *                 bif_list[2] = d2
 *                 u_nmp1[0], u_nmp1[1], u_nmp1[2], u_nmp1[3], u_nmp1[4], u_nmp1[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 x_n[0], x_n[1], x_n[2], x_n[3], x_n[4], x_n[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0             # <<<<<<<<<<<<<<
 *                 last_index = v_U[par].u.shape[1]
 *                 first_index = 0
 */
      __pyx_t_66 = 0.0;
      __pyx_t_65 = 0.0;
      __pyx_t_64 = 0.0;
      __pyx_t_63 = 0.0;
      __pyx_t_62 = 0.0;
      __pyx_t_15 = 0.0;
      __pyx_t_73 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_73)) )) = __pyx_t_66;
      __pyx_t_74 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_74)) )) = __pyx_t_65;
      __pyx_t_75 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_75)) )) = __pyx_t_64;
      __pyx_t_76 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_76)) )) = __pyx_t_63;
      __pyx_t_77 = 4;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_77)) )) = __pyx_t_62;
      __pyx_t_78 = 5;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_78)) )) = __pyx_t_15;

      /* "pylsewave/cynum.pyx":2275
 *                 u_nmp1[0], u_nmp1[1], u_nmp1[2], u_nmp1[3], u_nmp1[4], u_nmp1[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 x_n[0], x_n[1], x_n[2], x_n[3], x_n[4], x_n[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[par].u.shape[1]             # <<<<<<<<<<<<<<
 *                 first_index = 0
 *                 u_nmp1[0] = v_U[par].u[0, last_index - 2]
 */
      __pyx_v_last_index = ((__pyx_v_v_U[__pyx_v_par]).u.shape[1]);

      /* "pylsewave/cynum.pyx":2276
 *                 x_n[0], x_n[1], x_n[2], x_n[3], x_n[4], x_n[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[par].u.shape[1]
 *                 first_index = 0             # <<<<<<<<<<<<<<
 *                 u_nmp1[0] = v_U[par].u[0, last_index - 2]
 *                 u_nmp1[1] = v_U[par].u[1, last_index - 2]
 */
      __pyx_v_first_index = 0;

      /* "pylsewave/cynum.pyx":2277
 *                 last_index = v_U[par].u.shape[1]
 *                 first_index = 0
 *                 u_nmp1[0] = v_U[par].u[0, last_index - 2]             # <<<<<<<<<<<<<<
 *                 u_nmp1[1] = v_U[par].u[1, last_index - 2]
 *                 # print v_U[par].u[1, last_index - 2]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_par]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_79 = 0;
      __pyx_t_80 = (__pyx_v_last_index - 2);
      __pyx_t_81 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_81)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_79 * __pyx_t_17.strides[0]) )) + __pyx_t_80)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2278
 *                 first_index = 0
 *                 u_nmp1[0] = v_U[par].u[0, last_index - 2]
 *                 u_nmp1[1] = v_U[par].u[1, last_index - 2]             # <<<<<<<<<<<<<<
 *                 # print v_U[par].u[1, last_index - 2]
 *                 x_n[0] = v_U[par].u_n[0, last_index - 1]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_par]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_82 = 1;
      __pyx_t_83 = (__pyx_v_last_index - 2);
      __pyx_t_84 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_84)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_82 * __pyx_t_17.strides[0]) )) + __pyx_t_83)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2280
 *                 u_nmp1[1] = v_U[par].u[1, last_index - 2]
 *                 # print v_U[par].u[1, last_index - 2]
 *                 x_n[0] = v_U[par].u_n[0, last_index - 1]             # <<<<<<<<<<<<<<
 *                 x_n[1] = v_U[par].u_n[1, last_index - 1]
 *                 u_nmp1[2] = v_U[d1].u[0, first_index + 1]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_par]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_85 = 0;
      __pyx_t_86 = (__pyx_v_last_index - 1);
      __pyx_t_87 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_87)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_85 * __pyx_t_17.strides[0]) )) + __pyx_t_86)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2281
 *                 # print v_U[par].u[1, last_index - 2]
 *                 x_n[0] = v_U[par].u_n[0, last_index - 1]
 *                 x_n[1] = v_U[par].u_n[1, last_index - 1]             # <<<<<<<<<<<<<<
 *                 u_nmp1[2] = v_U[d1].u[0, first_index + 1]
 *                 u_nmp1[3] = v_U[d1].u[1, first_index + 1]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_par]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_88 = 1;
      __pyx_t_89 = (__pyx_v_last_index - 1);
      __pyx_t_90 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_90)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_88 * __pyx_t_17.strides[0]) )) + __pyx_t_89)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2282
 *                 x_n[0] = v_U[par].u_n[0, last_index - 1]
 *                 x_n[1] = v_U[par].u_n[1, last_index - 1]
 *                 u_nmp1[2] = v_U[d1].u[0, first_index + 1]             # <<<<<<<<<<<<<<
 *                 u_nmp1[3] = v_U[d1].u[1, first_index + 1]
 *                 x_n[2] = v_U[d1].u_n[0, first_index]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_91 = 0;
      __pyx_t_92 = (__pyx_v_first_index + 1);
      __pyx_t_93 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_93)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_91 * __pyx_t_17.strides[0]) )) + __pyx_t_92)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2283
 *                 x_n[1] = v_U[par].u_n[1, last_index - 1]
 *                 u_nmp1[2] = v_U[d1].u[0, first_index + 1]
 *                 u_nmp1[3] = v_U[d1].u[1, first_index + 1]             # <<<<<<<<<<<<<<
 *                 x_n[2] = v_U[d1].u_n[0, first_index]
 *                 x_n[3] = v_U[d1].u_n[1, first_index]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_94 = 1;
      __pyx_t_95 = (__pyx_v_first_index + 1);
      __pyx_t_96 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_96)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_94 * __pyx_t_17.strides[0]) )) + __pyx_t_95)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2284
 *                 u_nmp1[2] = v_U[d1].u[0, first_index + 1]
 *                 u_nmp1[3] = v_U[d1].u[1, first_index + 1]
 *                 x_n[2] = v_U[d1].u_n[0, first_index]             # <<<<<<<<<<<<<<
 *                 x_n[3] = v_U[d1].u_n[1, first_index]
 *                 u_nmp1[4] = v_U[d2].u[0, first_index + 1]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_97 = 0;
      __pyx_t_98 = __pyx_v_first_index;
      __pyx_t_99 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_99)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_97 * __pyx_t_17.strides[0]) )) + __pyx_t_98)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2285
 *                 u_nmp1[3] = v_U[d1].u[1, first_index + 1]
 *                 x_n[2] = v_U[d1].u_n[0, first_index]
 *                 x_n[3] = v_U[d1].u_n[1, first_index]             # <<<<<<<<<<<<<<
 *                 u_nmp1[4] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1[5] = v_U[d2].u[1, first_index + 1]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_100 = 1;
      __pyx_t_101 = __pyx_v_first_index;
      __pyx_t_102 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_102)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_100 * __pyx_t_17.strides[0]) )) + __pyx_t_101)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2286
 *                 x_n[2] = v_U[d1].u_n[0, first_index]
 *                 x_n[3] = v_U[d1].u_n[1, first_index]
 *                 u_nmp1[4] = v_U[d2].u[0, first_index + 1]             # <<<<<<<<<<<<<<
 *                 u_nmp1[5] = v_U[d2].u[1, first_index + 1]
 *                 x_n[4] = v_U[d2].u_n[0, first_index]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_103 = 0;
      __pyx_t_104 = (__pyx_v_first_index + 1);
      __pyx_t_105 = 4;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_105)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_103 * __pyx_t_17.strides[0]) )) + __pyx_t_104)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2287
 *                 x_n[3] = v_U[d1].u_n[1, first_index]
 *                 u_nmp1[4] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1[5] = v_U[d2].u[1, first_index + 1]             # <<<<<<<<<<<<<<
 *                 x_n[4] = v_U[d2].u_n[0, first_index]
 *                 x_n[5] = v_U[d2].u_n[1, first_index]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_106 = 1;
      __pyx_t_107 = (__pyx_v_first_index + 1);
      __pyx_t_108 = 5;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_108)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_106 * __pyx_t_17.strides[0]) )) + __pyx_t_107)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2288
 *                 u_nmp1[4] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1[5] = v_U[d2].u[1, first_index + 1]
 *                 x_n[4] = v_U[d2].u_n[0, first_index]             # <<<<<<<<<<<<<<
 *                 x_n[5] = v_U[d2].u_n[1, first_index]
 * 
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_109 = 0;
      __pyx_t_110 = __pyx_v_first_index;
      __pyx_t_111 = 4;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_111)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_109 * __pyx_t_17.strides[0]) )) + __pyx_t_110)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2289
 *                 u_nmp1[5] = v_U[d2].u[1, first_index + 1]
 *                 x_n[4] = v_U[d2].u_n[0, first_index]
 *                 x_n[5] = v_U[d2].u_n[1, first_index]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_112 = 1;
      __pyx_t_113 = __pyx_v_first_index;
      __pyx_t_114 = 5;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_114)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_112 * __pyx_t_17.strides[0]) )) + __pyx_t_113)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2293
 * 
 *                 # return SOLVER.SOLVER_STATUS_ERROR
 *                 iter_count = Newton_Raphson_Sys_bif(self._bcs, x_n, u_nmp1, self._dt,             # <<<<<<<<<<<<<<
 *                                                     bif_list, 1.0e-9, 100)
 * 
 */
      __pyx_t_37 = ((PyObject *)__pyx_v_self->_bcs);
      __Pyx_INCREF(__pyx_t_37);

      /* "pylsewave/cynum.pyx":2294
 *                 # return SOLVER.SOLVER_STATUS_ERROR
 *                 iter_count = Newton_Raphson_Sys_bif(self._bcs, x_n, u_nmp1, self._dt,
 *                                                     bif_list, 1.0e-9, 100)             # <<<<<<<<<<<<<<
 * 
 *                 # print iter_count
 */
      __pyx_t_115.__pyx_n = 1;
      __pyx_t_115.N = 0x64;
      __pyx_t_43 = __pyx_f_9pylsewave_5cynum_Newton_Raphson_Sys_bif(((struct __pyx_obj_9pylsewave_5cynum_cBCs *)__pyx_t_37), __pyx_v_x_n, __pyx_v_u_nmp1, __pyx_v_self->_dt, __pyx_v_bif_list, 1.0e-9, &__pyx_t_115); 
      __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
      __pyx_v_iter_count = __pyx_t_43;

      /* "pylsewave/cynum.pyx":2297
 * 
 *                 # print iter_count
 *                 v_U[par].u[0, last_index - 1] = x_n[0]             # <<<<<<<<<<<<<<
 *                 v_U[par].u[1, last_index - 1] = x_n[1]
 *                 v_U[d1].u[0, 0] = x_n[2]
 */
      __pyx_t_116 = 0;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_par]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_117 = 0;
      __pyx_t_118 = (__pyx_v_last_index - 1);
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_117 * __pyx_t_17.strides[0]) )) + __pyx_t_118)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_116)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2298
 *                 # print iter_count
 *                 v_U[par].u[0, last_index - 1] = x_n[0]
 *                 v_U[par].u[1, last_index - 1] = x_n[1]             # <<<<<<<<<<<<<<
 *                 v_U[d1].u[0, 0] = x_n[2]
 *                 v_U[d1].u[1, 0] = x_n[3]
 */
      __pyx_t_119 = 1;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_par]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_120 = 1;
      __pyx_t_121 = (__pyx_v_last_index - 1);
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_120 * __pyx_t_17.strides[0]) )) + __pyx_t_121)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_119)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2299
 *                 v_U[par].u[0, last_index - 1] = x_n[0]
 *                 v_U[par].u[1, last_index - 1] = x_n[1]
 *                 v_U[d1].u[0, 0] = x_n[2]             # <<<<<<<<<<<<<<
 *                 v_U[d1].u[1, 0] = x_n[3]
 *                 v_U[d2].u[0, 0] = x_n[4]
 */
      __pyx_t_122 = 2;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_123 = 0;
      __pyx_t_124 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_123 * __pyx_t_17.strides[0]) )) + __pyx_t_124)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_122)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2300
 *                 v_U[par].u[1, last_index - 1] = x_n[1]
 *                 v_U[d1].u[0, 0] = x_n[2]
 *                 v_U[d1].u[1, 0] = x_n[3]             # <<<<<<<<<<<<<<
 *                 v_U[d2].u[0, 0] = x_n[4]
 *                 v_U[d2].u[1, 0] = x_n[5]
 */
      __pyx_t_125 = 3;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_126 = 1;
      __pyx_t_127 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_126 * __pyx_t_17.strides[0]) )) + __pyx_t_127)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_125)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2301
 *                 v_U[d1].u[0, 0] = x_n[2]
 *                 v_U[d1].u[1, 0] = x_n[3]
 *                 v_U[d2].u[0, 0] = x_n[4]             # <<<<<<<<<<<<<<
 *                 v_U[d2].u[1, 0] = x_n[5]
 * 
 */
      __pyx_t_128 = 4;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_129 = 0;
      __pyx_t_130 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_129 * __pyx_t_17.strides[0]) )) + __pyx_t_130)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_128)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2302
 *                 v_U[d1].u[1, 0] = x_n[3]
 *                 v_U[d2].u[0, 0] = x_n[4]
 *                 v_U[d2].u[1, 0] = x_n[5]             # <<<<<<<<<<<<<<
 * 
 *             for index in range(siz_UConj):
 */
      __pyx_t_131 = 5;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_132 = 1;
      __pyx_t_133 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_132 * __pyx_t_17.strides[0]) )) + __pyx_t_133)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_131)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
    }

    /* "pylsewave/cynum.pyx":2304
 *                 v_U[d2].u[1, 0] = x_n[5]
 * 
 *             for index in range(siz_UConj):             # <<<<<<<<<<<<<<
 *                 d1 = self.UConj_arr[index, 0]
 *                 d2 = self.UConj_arr[index, 1]
 */
    __pyx_t_47 = __pyx_v_siz_UConj;
    for (__pyx_t_44 = 0; __pyx_t_44 < __pyx_t_47; __pyx_t_44+=1) {
      __pyx_v_index = __pyx_t_44;

      /* "pylsewave/cynum.pyx":2305
 * 
 *             for index in range(siz_UConj):
 *                 d1 = self.UConj_arr[index, 0]             # <<<<<<<<<<<<<<
 *                 d2 = self.UConj_arr[index, 1]
 *                 conj_list[0] = d1
 */
      __pyx_t_134 = __pyx_v_index;
      __pyx_t_135 = 0;
      __pyx_v_d1 = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->UConj_arr.data + __pyx_t_134 * __pyx_v_self->UConj_arr.strides[0]) )) + __pyx_t_135)) )));

      /* "pylsewave/cynum.pyx":2306
 *             for index in range(siz_UConj):
 *                 d1 = self.UConj_arr[index, 0]
 *                 d2 = self.UConj_arr[index, 1]             # <<<<<<<<<<<<<<
 *                 conj_list[0] = d1
 *                 conj_list[1] = d2
 */
      __pyx_t_136 = __pyx_v_index;
      __pyx_t_137 = 1;
      __pyx_v_d2 = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->UConj_arr.data + __pyx_t_136 * __pyx_v_self->UConj_arr.strides[0]) )) + __pyx_t_137)) )));

      /* "pylsewave/cynum.pyx":2307
 *                 d1 = self.UConj_arr[index, 0]
 *                 d2 = self.UConj_arr[index, 1]
 *                 conj_list[0] = d1             # <<<<<<<<<<<<<<
 *                 conj_list[1] = d2
 *                 u_nmp1_conj[0], u_nmp1_conj[1], u_nmp1_conj[2], u_nmp1_conj[3] = 0.0, 0.0, 0.0, 0.0
 */
      __pyx_t_138 = 0;
      *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_conj_list.data) + __pyx_t_138)) )) = __pyx_v_d1;

      /* "pylsewave/cynum.pyx":2308
 *                 d2 = self.UConj_arr[index, 1]
 *                 conj_list[0] = d1
 *                 conj_list[1] = d2             # <<<<<<<<<<<<<<
 *                 u_nmp1_conj[0], u_nmp1_conj[1], u_nmp1_conj[2], u_nmp1_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 x_n_conj[0], x_n_conj[1], x_n_conj[2], x_n_conj[3] = 0.0, 0.0, 0.0, 0.0
 */
      __pyx_t_139 = 1;
      *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_conj_list.data) + __pyx_t_139)) )) = __pyx_v_d2;

      /* "pylsewave/cynum.pyx":2309
 *                 conj_list[0] = d1
 *                 conj_list[1] = d2
 *                 u_nmp1_conj[0], u_nmp1_conj[1], u_nmp1_conj[2], u_nmp1_conj[3] = 0.0, 0.0, 0.0, 0.0             # <<<<<<<<<<<<<<
 *                 x_n_conj[0], x_n_conj[1], x_n_conj[2], x_n_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[d1].u.shape[1]
 */
      __pyx_t_15 = 0.0;
      __pyx_t_62 = 0.0;
      __pyx_t_63 = 0.0;
      __pyx_t_64 = 0.0;
      __pyx_t_140 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_140)) )) = __pyx_t_15;
      __pyx_t_141 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_141)) )) = __pyx_t_62;
      __pyx_t_142 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_142)) )) = __pyx_t_63;
      __pyx_t_143 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_143)) )) = __pyx_t_64;

      /* "pylsewave/cynum.pyx":2310
 *                 conj_list[1] = d2
 *                 u_nmp1_conj[0], u_nmp1_conj[1], u_nmp1_conj[2], u_nmp1_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 x_n_conj[0], x_n_conj[1], x_n_conj[2], x_n_conj[3] = 0.0, 0.0, 0.0, 0.0             # <<<<<<<<<<<<<<
 *                 last_index = v_U[d1].u.shape[1]
 *                 first_index = 0
 */
      __pyx_t_64 = 0.0;
      __pyx_t_63 = 0.0;
      __pyx_t_62 = 0.0;
      __pyx_t_15 = 0.0;
      __pyx_t_144 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_144)) )) = __pyx_t_64;
      __pyx_t_145 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_145)) )) = __pyx_t_63;
      __pyx_t_146 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_146)) )) = __pyx_t_62;
      __pyx_t_147 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_147)) )) = __pyx_t_15;

      /* "pylsewave/cynum.pyx":2311
 *                 u_nmp1_conj[0], u_nmp1_conj[1], u_nmp1_conj[2], u_nmp1_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 x_n_conj[0], x_n_conj[1], x_n_conj[2], x_n_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[d1].u.shape[1]             # <<<<<<<<<<<<<<
 *                 first_index = 0
 *                 u_nmp1_conj[0] = v_U[d1].u[0, last_index - 2]
 */
      __pyx_v_last_index = ((__pyx_v_v_U[__pyx_v_d1]).u.shape[1]);

      /* "pylsewave/cynum.pyx":2312
 *                 x_n_conj[0], x_n_conj[1], x_n_conj[2], x_n_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[d1].u.shape[1]
 *                 first_index = 0             # <<<<<<<<<<<<<<
 *                 u_nmp1_conj[0] = v_U[d1].u[0, last_index - 2]
 *                 u_nmp1_conj[1] = v_U[d1].u[1, last_index - 2]
 */
      __pyx_v_first_index = 0;

      /* "pylsewave/cynum.pyx":2313
 *                 last_index = v_U[d1].u.shape[1]
 *                 first_index = 0
 *                 u_nmp1_conj[0] = v_U[d1].u[0, last_index - 2]             # <<<<<<<<<<<<<<
 *                 u_nmp1_conj[1] = v_U[d1].u[1, last_index - 2]
 *                 x_n_conj[0] = v_U[d1].u_n[0, last_index - 1]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_148 = 0;
      __pyx_t_149 = (__pyx_v_last_index - 2);
      __pyx_t_150 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_150)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_148 * __pyx_t_17.strides[0]) )) + __pyx_t_149)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2314
 *                 first_index = 0
 *                 u_nmp1_conj[0] = v_U[d1].u[0, last_index - 2]
 *                 u_nmp1_conj[1] = v_U[d1].u[1, last_index - 2]             # <<<<<<<<<<<<<<
 *                 x_n_conj[0] = v_U[d1].u_n[0, last_index - 1]
 *                 x_n_conj[1] = v_U[d1].u_n[1, last_index - 1]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_151 = 1;
      __pyx_t_152 = (__pyx_v_last_index - 2);
      __pyx_t_153 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_153)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_151 * __pyx_t_17.strides[0]) )) + __pyx_t_152)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2315
 *                 u_nmp1_conj[0] = v_U[d1].u[0, last_index - 2]
 *                 u_nmp1_conj[1] = v_U[d1].u[1, last_index - 2]
 *                 x_n_conj[0] = v_U[d1].u_n[0, last_index - 1]             # <<<<<<<<<<<<<<
 *                 x_n_conj[1] = v_U[d1].u_n[1, last_index - 1]
 *                 u_nmp1_conj[2] = v_U[d2].u[0, first_index + 1]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_154 = 0;
      __pyx_t_155 = (__pyx_v_last_index - 1);
      __pyx_t_156 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_156)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_154 * __pyx_t_17.strides[0]) )) + __pyx_t_155)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2316
 *                 u_nmp1_conj[1] = v_U[d1].u[1, last_index - 2]
 *                 x_n_conj[0] = v_U[d1].u_n[0, last_index - 1]
 *                 x_n_conj[1] = v_U[d1].u_n[1, last_index - 1]             # <<<<<<<<<<<<<<
 *                 u_nmp1_conj[2] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1_conj[3] = v_U[d2].u[1, first_index + 1]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_157 = 1;
      __pyx_t_158 = (__pyx_v_last_index - 1);
      __pyx_t_159 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_159)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_157 * __pyx_t_17.strides[0]) )) + __pyx_t_158)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2317
 *                 x_n_conj[0] = v_U[d1].u_n[0, last_index - 1]
 *                 x_n_conj[1] = v_U[d1].u_n[1, last_index - 1]
 *                 u_nmp1_conj[2] = v_U[d2].u[0, first_index + 1]             # <<<<<<<<<<<<<<
 *                 u_nmp1_conj[3] = v_U[d2].u[1, first_index + 1]
 *                 x_n_conj[2] = v_U[d2].u_n[0, first_index]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_160 = 0;
      __pyx_t_161 = (__pyx_v_first_index + 1);
      __pyx_t_162 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_162)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_160 * __pyx_t_17.strides[0]) )) + __pyx_t_161)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2318
 *                 x_n_conj[1] = v_U[d1].u_n[1, last_index - 1]
 *                 u_nmp1_conj[2] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1_conj[3] = v_U[d2].u[1, first_index + 1]             # <<<<<<<<<<<<<<
 *                 x_n_conj[2] = v_U[d2].u_n[0, first_index]
 *                 x_n_conj[3] = v_U[d2].u_n[1, first_index]
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_163 = 1;
      __pyx_t_164 = (__pyx_v_first_index + 1);
      __pyx_t_165 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_165)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_163 * __pyx_t_17.strides[0]) )) + __pyx_t_164)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2319
 *                 u_nmp1_conj[2] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1_conj[3] = v_U[d2].u[1, first_index + 1]
 *                 x_n_conj[2] = v_U[d2].u_n[0, first_index]             # <<<<<<<<<<<<<<
 *                 x_n_conj[3] = v_U[d2].u_n[1, first_index]
 * 
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_166 = 0;
      __pyx_t_167 = __pyx_v_first_index;
      __pyx_t_168 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_168)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_166 * __pyx_t_17.strides[0]) )) + __pyx_t_167)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2320
 *                 u_nmp1_conj[3] = v_U[d2].u[1, first_index + 1]
 *                 x_n_conj[2] = v_U[d2].u_n[0, first_index]
 *                 x_n_conj[3] = v_U[d2].u_n[1, first_index]             # <<<<<<<<<<<<<<
 * 
 *                 iter_count = Newton_Raphson_Sys_conj(self._bcs, x_n_conj, u_nmp1_conj, self._dt,
 */
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_169 = 1;
      __pyx_t_170 = __pyx_v_first_index;
      __pyx_t_171 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_171)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_169 * __pyx_t_17.strides[0]) )) + __pyx_t_170)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2322
 *                 x_n_conj[3] = v_U[d2].u_n[1, first_index]
 * 
 *                 iter_count = Newton_Raphson_Sys_conj(self._bcs, x_n_conj, u_nmp1_conj, self._dt,             # <<<<<<<<<<<<<<
 *                                                      conj_list, 1.0e-9, 100)
 * 
 */
      __pyx_t_37 = ((PyObject *)__pyx_v_self->_bcs);
      __Pyx_INCREF(__pyx_t_37);

      /* "pylsewave/cynum.pyx":2323
 * 
 *                 iter_count = Newton_Raphson_Sys_conj(self._bcs, x_n_conj, u_nmp1_conj, self._dt,
 *                                                      conj_list, 1.0e-9, 100)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_172.__pyx_n = 1;
      __pyx_t_172.N = 0x64;
      __pyx_t_43 = __pyx_f_9pylsewave_5cynum_Newton_Raphson_Sys_conj(((struct __pyx_obj_9pylsewave_5cynum_cBCs *)__pyx_t_37), __pyx_v_x_n_conj, __pyx_v_u_nmp1_conj, __pyx_v_self->_dt, __pyx_v_conj_list, 1.0e-9, &__pyx_t_172); 
      __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
      __pyx_v_iter_count = __pyx_t_43;

      /* "pylsewave/cynum.pyx":2326
 * 
 * 
 *                 v_U[d1].u[0, last_index - 1] = x_n_conj[0]             # <<<<<<<<<<<<<<
 *                 v_U[d1].u[1, last_index - 1] = x_n_conj[1]
 *                 v_U[d2].u[0, 0] = x_n_conj[2]
 */
      __pyx_t_173 = 0;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_174 = 0;
      __pyx_t_175 = (__pyx_v_last_index - 1);
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_174 * __pyx_t_17.strides[0]) )) + __pyx_t_175)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_173)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2327
 * 
 *                 v_U[d1].u[0, last_index - 1] = x_n_conj[0]
 *                 v_U[d1].u[1, last_index - 1] = x_n_conj[1]             # <<<<<<<<<<<<<<
 *                 v_U[d2].u[0, 0] = x_n_conj[2]
 *                 v_U[d2].u[1, 0] = x_n_conj[3]
 */
      __pyx_t_176 = 1;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_177 = 1;
      __pyx_t_178 = (__pyx_v_last_index - 1);
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_177 * __pyx_t_17.strides[0]) )) + __pyx_t_178)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_176)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2328
 *                 v_U[d1].u[0, last_index - 1] = x_n_conj[0]
 *                 v_U[d1].u[1, last_index - 1] = x_n_conj[1]
 *                 v_U[d2].u[0, 0] = x_n_conj[2]             # <<<<<<<<<<<<<<
 *                 v_U[d2].u[1, 0] = x_n_conj[3]
 * 
 */
      __pyx_t_179 = 2;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_180 = 0;
      __pyx_t_181 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_180 * __pyx_t_17.strides[0]) )) + __pyx_t_181)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_179)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

      /* "pylsewave/cynum.pyx":2329
 *                 v_U[d1].u[1, last_index - 1] = x_n_conj[1]
 *                 v_U[d2].u[0, 0] = x_n_conj[2]
 *                 v_U[d2].u[1, 0] = x_n_conj[3]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_182 = 3;
      __pyx_t_17 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
      __pyx_t_183 = 1;
      __pyx_t_184 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_183 * __pyx_t_17.strides[0]) )) + __pyx_t_184)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_182)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
    }

    /* "pylsewave/cynum.pyx":2332
 * 
 * 
 *             for i in range(length):             # <<<<<<<<<<<<<<
 *                 if (user_action is not None) and (n % user_action.skip_frame == 0):
 *                     # # check cfl condition
 */
    __pyx_t_14 = __pyx_v_length;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "pylsewave/cynum.pyx":2333
 * 
 *             for i in range(length):
 *                 if (user_action is not None) and (n % user_action.skip_frame == 0):             # <<<<<<<<<<<<<<
 *                     # # check cfl condition
 *                     res_cfl = self.cfl_condition(v_U[i].u, v_U[i].dx, self._dt, i)
 */
      __pyx_t_24 = (__pyx_v_user_action != Py_None);
      __pyx_t_185 = (__pyx_t_24 != 0);
      if (__pyx_t_185) {
      } else {
        __pyx_t_23 = __pyx_t_185;
        goto __pyx_L43_bool_binop_done;
      }
      __pyx_t_37 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_37);
      __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_v_user_action, __pyx_n_s_skip_frame); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_38);
      __pyx_t_2 = PyNumber_Remainder(__pyx_t_37, __pyx_t_38); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
      __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
      __pyx_t_38 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_38);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_185 = __Pyx_PyObject_IsTrue(__pyx_t_38); if (unlikely(__pyx_t_185 < 0)) __PYX_ERR(0, 2333, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
      __pyx_t_23 = __pyx_t_185;
      __pyx_L43_bool_binop_done:;
      if (__pyx_t_23) {

        /* "pylsewave/cynum.pyx":2335
 *                 if (user_action is not None) and (n % user_action.skip_frame == 0):
 *                     # # check cfl condition
 *                     res_cfl = self.cfl_condition(v_U[i].u, v_U[i].dx, self._dt, i)             # <<<<<<<<<<<<<<
 *                     if res_cfl == CFL.CFL_STATUS_ERROR:
 *                         print("Solver failed in vessel %d in time increment %d  spatial %d and lenght=%d" % (i, n, j, v_U[i].x_size))
 */
        __pyx_v_res_cfl = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self->__pyx_vtab)->cfl_condition(__pyx_v_self, (__pyx_v_v_U[__pyx_v_i]).u, (__pyx_v_v_U[__pyx_v_i]).dx, __pyx_v_self->_dt, __pyx_v_i);

        /* "pylsewave/cynum.pyx":2336
 *                     # # check cfl condition
 *                     res_cfl = self.cfl_condition(v_U[i].u, v_U[i].dx, self._dt, i)
 *                     if res_cfl == CFL.CFL_STATUS_ERROR:             # <<<<<<<<<<<<<<
 *                         print("Solver failed in vessel %d in time increment %d  spatial %d and lenght=%d" % (i, n, j, v_U[i].x_size))
 *                         return SOLVER.SOLVER_STATUS_ERROR
 */
        __pyx_t_23 = ((__pyx_v_res_cfl == __pyx_e_9pylsewave_5cynum_CFL_STATUS_ERROR) != 0);
        if (__pyx_t_23) {

          /* "pylsewave/cynum.pyx":2337
 *                     res_cfl = self.cfl_condition(v_U[i].u, v_U[i].dx, self._dt, i)
 *                     if res_cfl == CFL.CFL_STATUS_ERROR:
 *                         print("Solver failed in vessel %d in time increment %d  spatial %d and lenght=%d" % (i, n, j, v_U[i].x_size))             # <<<<<<<<<<<<<<
 *                         return SOLVER.SOLVER_STATUS_ERROR
 *                     else:
 */
          __pyx_t_38 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2337, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_38);
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2337, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_37 = PyInt_FromSsize_t(__pyx_v_j); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2337, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_37);
          __pyx_t_41 = PyInt_FromSsize_t((__pyx_v_v_U[__pyx_v_i]).x_size); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2337, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_41);
          __pyx_t_39 = PyTuple_New(4); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2337, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_39);
          __Pyx_GIVEREF(__pyx_t_38);
          PyTuple_SET_ITEM(__pyx_t_39, 0, __pyx_t_38);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_39, 1, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_37);
          PyTuple_SET_ITEM(__pyx_t_39, 2, __pyx_t_37);
          __Pyx_GIVEREF(__pyx_t_41);
          PyTuple_SET_ITEM(__pyx_t_39, 3, __pyx_t_41);
          __pyx_t_38 = 0;
          __pyx_t_2 = 0;
          __pyx_t_37 = 0;
          __pyx_t_41 = 0;
          __pyx_t_41 = __Pyx_PyString_Format(__pyx_kp_s_Solver_failed_in_vessel_d_in_tim, __pyx_t_39); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2337, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_41);
          __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
          if (__Pyx_PrintOne(0, __pyx_t_41) < 0) __PYX_ERR(0, 2337, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;

          /* "pylsewave/cynum.pyx":2338
 *                     if res_cfl == CFL.CFL_STATUS_ERROR:
 *                         print("Solver failed in vessel %d in time increment %d  spatial %d and lenght=%d" % (i, n, j, v_U[i].x_size))
 *                         return SOLVER.SOLVER_STATUS_ERROR             # <<<<<<<<<<<<<<
 *                     else:
 *                         for j in range(v_U[i].x_size):
 */
          __pyx_r = __pyx_e_9pylsewave_5cynum_SOLVER_STATUS_ERROR;
          goto __pyx_L0;

          /* "pylsewave/cynum.pyx":2336
 *                     # # check cfl condition
 *                     res_cfl = self.cfl_condition(v_U[i].u, v_U[i].dx, self._dt, i)
 *                     if res_cfl == CFL.CFL_STATUS_ERROR:             # <<<<<<<<<<<<<<
 *                         print("Solver failed in vessel %d in time increment %d  spatial %d and lenght=%d" % (i, n, j, v_U[i].x_size))
 *                         return SOLVER.SOLVER_STATUS_ERROR
 */
        }

        /* "pylsewave/cynum.pyx":2340
 *                         return SOLVER.SOLVER_STATUS_ERROR
 *                     else:
 *                         for j in range(v_U[i].x_size):             # <<<<<<<<<<<<<<
 *                             getarr[0] = v_U[i].u[0, j]
 *                             getarr[1] = v_U[i].u[1, j]
 */
        /*else*/ {
          __pyx_t_12 = (__pyx_v_v_U[__pyx_v_i]).x_size;
          for (__pyx_t_186 = 0; __pyx_t_186 < __pyx_t_12; __pyx_t_186+=1) {
            __pyx_v_j = __pyx_t_186;

            /* "pylsewave/cynum.pyx":2341
 *                     else:
 *                         for j in range(v_U[i].x_size):
 *                             getarr[0] = v_U[i].u[0, j]             # <<<<<<<<<<<<<<
 *                             getarr[1] = v_U[i].u[1, j]
 * 
 */
            __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u;
            __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
            __pyx_t_187 = 0;
            __pyx_t_188 = __pyx_v_j;
            __pyx_t_189 = 0;
            *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_getarr.data) + __pyx_t_189)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_187 * __pyx_t_17.strides[0]) )) + __pyx_t_188)) )));
            __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

            /* "pylsewave/cynum.pyx":2342
 *                         for j in range(v_U[i].x_size):
 *                             getarr[0] = v_U[i].u[0, j]
 *                             getarr[1] = v_U[i].u[1, j]             # <<<<<<<<<<<<<<
 * 
 *                             p = self._pdes.pressure_i(getarr[0], j, vessel_index=i)
 */
            __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u;
            __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
            __pyx_t_190 = 1;
            __pyx_t_191 = __pyx_v_j;
            __pyx_t_192 = 1;
            *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_getarr.data) + __pyx_t_192)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_190 * __pyx_t_17.strides[0]) )) + __pyx_t_191)) )));
            __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

            /* "pylsewave/cynum.pyx":2344
 *                             getarr[1] = v_U[i].u[1, j]
 * 
 *                             p = self._pdes.pressure_i(getarr[0], j, vessel_index=i)             # <<<<<<<<<<<<<<
 * 
 *                             v_U[i].u_store[0, j] = v_U[i].u[0, j]
 */
            __pyx_t_193 = 0;
            __pyx_v_p = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->pressure_i(__pyx_v_self->_pdes, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_getarr.data) + __pyx_t_193)) ))), __pyx_v_j, __pyx_v_i);

            /* "pylsewave/cynum.pyx":2346
 *                             p = self._pdes.pressure_i(getarr[0], j, vessel_index=i)
 * 
 *                             v_U[i].u_store[0, j] = v_U[i].u[0, j]             # <<<<<<<<<<<<<<
 *                             v_U[i].u_store[1, j] = v_U[i].u[1, j]
 *                             v_U[i].u_store[2, j] = p
 */
            __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u;
            __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
            __pyx_t_194 = 0;
            __pyx_t_195 = __pyx_v_j;
            __pyx_t_28 = (__pyx_v_v_U[__pyx_v_i]).u_store;
            __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
            __pyx_t_196 = 0;
            __pyx_t_197 = __pyx_v_j;
            *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_28.data + __pyx_t_196 * __pyx_t_28.strides[0]) )) + __pyx_t_197)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_194 * __pyx_t_17.strides[0]) )) + __pyx_t_195)) )));
            __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
            __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

            /* "pylsewave/cynum.pyx":2347
 * 
 *                             v_U[i].u_store[0, j] = v_U[i].u[0, j]
 *                             v_U[i].u_store[1, j] = v_U[i].u[1, j]             # <<<<<<<<<<<<<<
 *                             v_U[i].u_store[2, j] = p
 * 
 */
            __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u;
            __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
            __pyx_t_198 = 1;
            __pyx_t_199 = __pyx_v_j;
            __pyx_t_28 = (__pyx_v_v_U[__pyx_v_i]).u_store;
            __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
            __pyx_t_200 = 1;
            __pyx_t_201 = __pyx_v_j;
            *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_28.data + __pyx_t_200 * __pyx_t_28.strides[0]) )) + __pyx_t_201)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_198 * __pyx_t_17.strides[0]) )) + __pyx_t_199)) )));
            __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
            __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

            /* "pylsewave/cynum.pyx":2348
 *                             v_U[i].u_store[0, j] = v_U[i].u[0, j]
 *                             v_U[i].u_store[1, j] = v_U[i].u[1, j]
 *                             v_U[i].u_store[2, j] = p             # <<<<<<<<<<<<<<
 * 
 *                         user_action(v_U[i].u_store, self.mesh.vessels[i].x, self._t, n, PRINT_STATUS, WRITE_STATUS, i)
 */
            __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u_store;
            __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
            __pyx_t_202 = 2;
            __pyx_t_203 = __pyx_v_j;
            *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_202 * __pyx_t_17.strides[0]) )) + __pyx_t_203)) )) = __pyx_v_p;
            __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
          }

          /* "pylsewave/cynum.pyx":2350
 *                             v_U[i].u_store[2, j] = p
 * 
 *                         user_action(v_U[i].u_store, self.mesh.vessels[i].x, self._t, n, PRINT_STATUS, WRITE_STATUS, i)             # <<<<<<<<<<<<<<
 *                     # cwrite2file("./run_cases/.tmpdata__u_%010d__vessel_%03d.dat" % (n, i), v_U[i].u_store)
 * 
 */
          __pyx_t_39 = __pyx_memoryview_fromslice((__pyx_v_v_U[__pyx_v_i]).u_store, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2350, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_39);
          __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2350, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_37);
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_37, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2350, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
          __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_x); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2350, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_37);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->_t, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2350, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_38 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2350, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_38);
          __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_PRINT_STATUS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2350, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_WRITE_STATUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2350, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2350, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_INCREF(__pyx_v_user_action);
          __pyx_t_1 = __pyx_v_user_action; __pyx_t_40 = NULL;
          __pyx_t_12 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_40 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_40)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_40);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_12 = 1;
            }
          }
          __pyx_t_204 = PyTuple_New(7+__pyx_t_12); if (unlikely(!__pyx_t_204)) __PYX_ERR(0, 2350, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_204);
          if (__pyx_t_40) {
            __Pyx_GIVEREF(__pyx_t_40); PyTuple_SET_ITEM(__pyx_t_204, 0, __pyx_t_40); __pyx_t_40 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_39);
          PyTuple_SET_ITEM(__pyx_t_204, 0+__pyx_t_12, __pyx_t_39);
          __Pyx_GIVEREF(__pyx_t_37);
          PyTuple_SET_ITEM(__pyx_t_204, 1+__pyx_t_12, __pyx_t_37);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_204, 2+__pyx_t_12, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_38);
          PyTuple_SET_ITEM(__pyx_t_204, 3+__pyx_t_12, __pyx_t_38);
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_204, 4+__pyx_t_12, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_204, 5+__pyx_t_12, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_204, 6+__pyx_t_12, __pyx_t_4);
          __pyx_t_39 = 0;
          __pyx_t_37 = 0;
          __pyx_t_2 = 0;
          __pyx_t_38 = 0;
          __pyx_t_6 = 0;
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_41 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_204, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2350, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_41);
          __Pyx_DECREF(__pyx_t_204); __pyx_t_204 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
        }

        /* "pylsewave/cynum.pyx":2333
 * 
 *             for i in range(length):
 *                 if (user_action is not None) and (n % user_action.skip_frame == 0):             # <<<<<<<<<<<<<<
 *                     # # check cfl condition
 *                     res_cfl = self.cfl_condition(v_U[i].u, v_U[i].dx, self._dt, i)
 */
      }

      /* "pylsewave/cynum.pyx":2353
 *                     # cwrite2file("./run_cases/.tmpdata__u_%010d__vessel_%03d.dat" % (n, i), v_U[i].u_store)
 * 
 *                 for j in range(v_U[i].x_size):             # <<<<<<<<<<<<<<
 *                     v_U[i].u_n[0, j] = v_U[i].u[0, j]
 *                     v_U[i].u_n[1, j] = v_U[i].u[1, j]
 */
      __pyx_t_12 = (__pyx_v_v_U[__pyx_v_i]).x_size;
      for (__pyx_t_186 = 0; __pyx_t_186 < __pyx_t_12; __pyx_t_186+=1) {
        __pyx_v_j = __pyx_t_186;

        /* "pylsewave/cynum.pyx":2354
 * 
 *                 for j in range(v_U[i].x_size):
 *                     v_U[i].u_n[0, j] = v_U[i].u[0, j]             # <<<<<<<<<<<<<<
 *                     v_U[i].u_n[1, j] = v_U[i].u[1, j]
 * 
 */
        __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u;
        __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
        __pyx_t_205 = 0;
        __pyx_t_206 = __pyx_v_j;
        __pyx_t_28 = (__pyx_v_v_U[__pyx_v_i]).u_n;
        __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
        __pyx_t_207 = 0;
        __pyx_t_208 = __pyx_v_j;
        *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_28.data + __pyx_t_207 * __pyx_t_28.strides[0]) )) + __pyx_t_208)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_205 * __pyx_t_17.strides[0]) )) + __pyx_t_206)) )));
        __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
        __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);

        /* "pylsewave/cynum.pyx":2355
 *                 for j in range(v_U[i].x_size):
 *                     v_U[i].u_n[0, j] = v_U[i].u[0, j]
 *                     v_U[i].u_n[1, j] = v_U[i].u[1, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_17 = (__pyx_v_v_U[__pyx_v_i]).u;
        __PYX_INC_MEMVIEW(&__pyx_t_17, 1);
        __pyx_t_209 = 1;
        __pyx_t_210 = __pyx_v_j;
        __pyx_t_28 = (__pyx_v_v_U[__pyx_v_i]).u_n;
        __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
        __pyx_t_211 = 1;
        __pyx_t_212 = __pyx_v_j;
        *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_28.data + __pyx_t_211 * __pyx_t_28.strides[0]) )) + __pyx_t_212)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_17.data + __pyx_t_209 * __pyx_t_17.strides[0]) )) + __pyx_t_210)) )));
        __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
        __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
      }
    }

    /* "pylsewave/cynum.pyx":2358
 * 
 * 
 *             printf("\r%6.2f%%", (100.0 * self._t[n] / self._T))             # <<<<<<<<<<<<<<
 *         return SOLVER.SOLVER_STATUS_OK
 * 
 */
    __pyx_t_213 = __pyx_v_n;
    printf(((char const *)"\r%6.2f%%"), ((100.0 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->_t.data) + __pyx_t_213)) )))) / __pyx_v_self->_T));
  }

  /* "pylsewave/cynum.pyx":2359
 * 
 *             printf("\r%6.2f%%", (100.0 * self._t[n] / self._T))
 *         return SOLVER.SOLVER_STATUS_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_e_9pylsewave_5cynum_SOLVER_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":2173
 *     @cython.initializedcheck(False)
 *     @cython.cdivision(True)
 *     cpdef SOLVER solve(self, user_action=None,             # <<<<<<<<<<<<<<
 *               version="vectorised"):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
  __Pyx_XDECREF(__pyx_t_37);
  __Pyx_XDECREF(__pyx_t_38);
  __Pyx_XDECREF(__pyx_t_39);
  __Pyx_XDECREF(__pyx_t_40);
  __Pyx_XDECREF(__pyx_t_41);
  __Pyx_XDECREF(__pyx_t_204);
  __Pyx_WriteUnraisable("pylsewave.cynum.cFDMSolver.solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = (enum __pyx_t_9pylsewave_5cynum_SOLVER) 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_getarr, 1);
  __Pyx_XDECREF(__pyx_v_time);
  __Pyx_XDECREF(__pyx_v_t0);
  __PYX_XDEC_MEMVIEW(&__pyx_v_u_nmp1, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_x_n, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_u_nmp1_conj, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_x_n_conj, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_bif_list, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_conj_list, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_10cFDMSolver_7solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_10cFDMSolver_7solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_user_action = 0;
  PyObject *__pyx_v_version = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("solve (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_user_action,&__pyx_n_s_version,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)__pyx_n_s_vectorised);
    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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_user_action);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solve") < 0)) __PYX_ERR(0, 2173, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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;
      }
    }
    __pyx_v_user_action = values[0];
    __pyx_v_version = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("solve", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2173, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cFDMSolver.solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_10cFDMSolver_6solve(((struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self), __pyx_v_user_action, __pyx_v_version);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_10cFDMSolver_6solve(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, PyObject *__pyx_v_user_action, PyObject *__pyx_v_version) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum __pyx_t_9pylsewave_5cynum_SOLVER __pyx_t_1;
  struct __pyx_opt_args_9pylsewave_5cynum_10cFDMSolver_solve __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("solve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.user_action = __pyx_v_user_action;
  __pyx_t_2.version = __pyx_v_version;
  __pyx_t_1 = __pyx_vtabptr_9pylsewave_5cynum_cFDMSolver->solve(__pyx_v_self, 1, &__pyx_t_2); 
  __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_9pylsewave_5cynum_SOLVER(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pylsewave.cynum.cFDMSolver.solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2366
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef void advance(self, U vec, double dt, double dx, int vessel_index) nogil:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t siz
 *         cdef Py_ssize_t i, j
 */

static void __pyx_f_9pylsewave_5cynum_10cFDMSolver_advance(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *__pyx_v_self, struct __pyx_t_9pylsewave_5cynum_U __pyx_v_vec, double __pyx_v_dt, double __pyx_v_dx, int __pyx_v_vessel_index) {
  Py_ssize_t __pyx_v_siz;
  Py_ssize_t __pyx_v_i;
  double __pyx_v_dt2;
  double __pyx_v_theta;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  Py_ssize_t __pyx_t_64;
  Py_ssize_t __pyx_t_65;
  Py_ssize_t __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  Py_ssize_t __pyx_t_70;
  Py_ssize_t __pyx_t_71;
  Py_ssize_t __pyx_t_72;
  Py_ssize_t __pyx_t_73;
  Py_ssize_t __pyx_t_74;
  Py_ssize_t __pyx_t_75;
  Py_ssize_t __pyx_t_76;
  Py_ssize_t __pyx_t_77;
  Py_ssize_t __pyx_t_78;
  Py_ssize_t __pyx_t_79;
  Py_ssize_t __pyx_t_80;
  Py_ssize_t __pyx_t_81;
  Py_ssize_t __pyx_t_82;
  Py_ssize_t __pyx_t_83;
  Py_ssize_t __pyx_t_84;
  Py_ssize_t __pyx_t_85;
  Py_ssize_t __pyx_t_86;
  Py_ssize_t __pyx_t_87;
  Py_ssize_t __pyx_t_88;
  Py_ssize_t __pyx_t_89;
  Py_ssize_t __pyx_t_90;
  Py_ssize_t __pyx_t_91;
  Py_ssize_t __pyx_t_92;
  Py_ssize_t __pyx_t_93;
  Py_ssize_t __pyx_t_94;
  Py_ssize_t __pyx_t_95;
  Py_ssize_t __pyx_t_96;
  Py_ssize_t __pyx_t_97;
  Py_ssize_t __pyx_t_98;
  Py_ssize_t __pyx_t_99;
  Py_ssize_t __pyx_t_100;
  Py_ssize_t __pyx_t_101;
  Py_ssize_t __pyx_t_102;
  Py_ssize_t __pyx_t_103;
  Py_ssize_t __pyx_t_104;
  Py_ssize_t __pyx_t_105;
  Py_ssize_t __pyx_t_106;
  Py_ssize_t __pyx_t_107;
  Py_ssize_t __pyx_t_108;
  Py_ssize_t __pyx_t_109;
  Py_ssize_t __pyx_t_110;
  Py_ssize_t __pyx_t_111;
  Py_ssize_t __pyx_t_112;
  Py_ssize_t __pyx_t_113;
  Py_ssize_t __pyx_t_114;

  /* "pylsewave/cynum.pyx":2372
 *         cdef double dt2, theta
 * 
 *         siz = vec.x_size             # <<<<<<<<<<<<<<
 * 
 *         dt2 = dt/2.
 */
  __pyx_t_1 = __pyx_v_vec.x_size;
  __pyx_v_siz = __pyx_t_1;

  /* "pylsewave/cynum.pyx":2374
 *         siz = vec.x_size
 * 
 *         dt2 = dt/2.             # <<<<<<<<<<<<<<
 * 
 *         theta = dt / dx
 */
  __pyx_v_dt2 = (__pyx_v_dt / 2.);

  /* "pylsewave/cynum.pyx":2376
 *         dt2 = dt/2.
 * 
 *         theta = dt / dx             # <<<<<<<<<<<<<<
 * 
 *         self._pdes.flux(vec.u_n, 0, vessel_index, vec.F_)
 */
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":2378
 *         theta = dt / dx
 * 
 *         self._pdes.flux(vec.u_n, 0, vessel_index, vec.F_)             # <<<<<<<<<<<<<<
 *         self._pdes.source(vec.u_n, 0, vessel_index, vec.S_)
 * 
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->flux(__pyx_v_self->_pdes, __pyx_v_vec.u_n, 0, __pyx_v_vessel_index, __pyx_v_vec.F_);

  /* "pylsewave/cynum.pyx":2379
 * 
 *         self._pdes.flux(vec.u_n, 0, vessel_index, vec.F_)
 *         self._pdes.source(vec.u_n, 0, vessel_index, vec.S_)             # <<<<<<<<<<<<<<
 * 
 * #         # U[n+1/2, i-1/2]
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->source(__pyx_v_self->_pdes, __pyx_v_vec.u_n, 0, __pyx_v_vessel_index, __pyx_v_vec.S_);

  /* "pylsewave/cynum.pyx":2383
 * #         # U[n+1/2, i-1/2]
 * #         with nogil, parallel(num_threads=4):
 *         for i in range(1, vec.x_size-1):             # <<<<<<<<<<<<<<
 *             vec.u_nh_mh[0, i] = ((vec.u_n[0, i] + vec.u_n[0, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 */
  __pyx_t_1 = (__pyx_v_vec.x_size - 1);
  for (__pyx_t_2 = 1; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2384
 * #         with nogil, parallel(num_threads=4):
 *         for i in range(1, vec.x_size-1):
 *             vec.u_nh_mh[0, i] = ((vec.u_n[0, i] + vec.u_n[0, i-1]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 */
    __pyx_t_3 = 0;
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = 0;
    __pyx_t_6 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2385
 *         for i in range(1, vec.x_size-1):
 *             vec.u_nh_mh[0, i] = ((vec.u_n[0, i] + vec.u_n[0, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +             # <<<<<<<<<<<<<<
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -
 */
    __pyx_t_7 = 0;
    __pyx_t_8 = __pyx_v_i;
    __pyx_t_9 = 0;
    __pyx_t_10 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2386
 *             vec.u_nh_mh[0, i] = ((vec.u_n[0, i] + vec.u_n[0, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))             # <<<<<<<<<<<<<<
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i] - vec.F_[1, i-1]) +
 */
    __pyx_t_11 = 0;
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = 0;
    __pyx_t_14 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2384
 * #         with nogil, parallel(num_threads=4):
 *         for i in range(1, vec.x_size-1):
 *             vec.u_nh_mh[0, i] = ((vec.u_n[0, i] + vec.u_n[0, i-1]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 */
    __pyx_t_15 = 0;
    __pyx_t_16 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_15 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_16)) )) = (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_3 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_4)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_5 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_6)) )))) / 2.) - ((0.5 * __pyx_v_theta) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_7 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_8)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_9 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_10)) )))))) + ((0.5 * __pyx_v_dt2) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_11 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_12)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_13 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_14)) ))))));

    /* "pylsewave/cynum.pyx":2387
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[1, i] - vec.F_[1, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))
 */
    __pyx_t_17 = 1;
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_19 = 1;
    __pyx_t_20 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2388
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i] - vec.F_[1, i-1]) +             # <<<<<<<<<<<<<<
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))
 * 
 */
    __pyx_t_21 = 1;
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_23 = 1;
    __pyx_t_24 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2389
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i] - vec.F_[1, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))             # <<<<<<<<<<<<<<
 * 
 *             vec.u_nh_ph[0, i] = ((vec.u_n[0, i+1] + vec.u_n[0, i]) / 2. -
 */
    __pyx_t_25 = 1;
    __pyx_t_26 = __pyx_v_i;
    __pyx_t_27 = 1;
    __pyx_t_28 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2387
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[1, i] - vec.F_[1, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))
 */
    __pyx_t_29 = 1;
    __pyx_t_30 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_29 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_30)) )) = (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_17 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_18)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_19 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_20)) )))) / 2.) - ((0.5 * __pyx_v_theta) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_21 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_22)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_23 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_24)) )))))) + ((0.5 * __pyx_v_dt2) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_25 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_26)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_27 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_28)) ))))));

    /* "pylsewave/cynum.pyx":2391
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))
 * 
 *             vec.u_nh_ph[0, i] = ((vec.u_n[0, i+1] + vec.u_n[0, i]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 */
    __pyx_t_31 = 0;
    __pyx_t_32 = (__pyx_v_i + 1);
    __pyx_t_33 = 0;
    __pyx_t_34 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2392
 * 
 *             vec.u_nh_ph[0, i] = ((vec.u_n[0, i+1] + vec.u_n[0, i]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +             # <<<<<<<<<<<<<<
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -
 */
    __pyx_t_35 = 0;
    __pyx_t_36 = (__pyx_v_i + 1);
    __pyx_t_37 = 0;
    __pyx_t_38 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2393
 *             vec.u_nh_ph[0, i] = ((vec.u_n[0, i+1] + vec.u_n[0, i]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))             # <<<<<<<<<<<<<<
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i+1] - vec.F_[1, i]) +
 */
    __pyx_t_39 = 0;
    __pyx_t_40 = (__pyx_v_i + 1);
    __pyx_t_41 = 0;
    __pyx_t_42 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2391
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))
 * 
 *             vec.u_nh_ph[0, i] = ((vec.u_n[0, i+1] + vec.u_n[0, i]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 */
    __pyx_t_43 = 0;
    __pyx_t_44 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_43 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_44)) )) = (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_31 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_32)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_33 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_34)) )))) / 2.) - ((0.5 * __pyx_v_theta) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_35 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_36)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_37 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_38)) )))))) + ((0.5 * __pyx_v_dt2) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_39 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_40)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_41 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_42)) ))))));

    /* "pylsewave/cynum.pyx":2394
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[1, i+1] - vec.F_[1, i]) +
 *                                  0.5 * dt2 * (vec.S_[1, i+1] + vec.S_[1, i]))
 */
    __pyx_t_45 = 1;
    __pyx_t_46 = (__pyx_v_i + 1);
    __pyx_t_47 = 1;
    __pyx_t_48 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2395
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i+1] - vec.F_[1, i]) +             # <<<<<<<<<<<<<<
 *                                  0.5 * dt2 * (vec.S_[1, i+1] + vec.S_[1, i]))
 * 
 */
    __pyx_t_49 = 1;
    __pyx_t_50 = (__pyx_v_i + 1);
    __pyx_t_51 = 1;
    __pyx_t_52 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2396
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i+1] - vec.F_[1, i]) +
 *                                  0.5 * dt2 * (vec.S_[1, i+1] + vec.S_[1, i]))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_53 = 1;
    __pyx_t_54 = (__pyx_v_i + 1);
    __pyx_t_55 = 1;
    __pyx_t_56 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2394
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[1, i+1] - vec.F_[1, i]) +
 *                                  0.5 * dt2 * (vec.S_[1, i+1] + vec.S_[1, i]))
 */
    __pyx_t_57 = 1;
    __pyx_t_58 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_57 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_58)) )) = (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_45 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_46)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_47 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_48)) )))) / 2.) - ((0.5 * __pyx_v_theta) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_49 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_50)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_51 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_52)) )))))) + ((0.5 * __pyx_v_dt2) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_53 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_54)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_55 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_56)) ))))));
  }

  /* "pylsewave/cynum.pyx":2400
 * 
 *         # this is a test, because we need to fill the edges with ghost
 *         vec.u_nh_mh[0, 0] = vec.u_n[0, 0]             # <<<<<<<<<<<<<<
 *         vec.u_nh_mh[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_mh[0, siz-1] = vec.u_n[0, siz-1]
 */
  __pyx_t_59 = 0;
  __pyx_t_60 = 0;
  __pyx_t_61 = 0;
  __pyx_t_62 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_61 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_62)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_59 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_60)) )));

  /* "pylsewave/cynum.pyx":2401
 *         # this is a test, because we need to fill the edges with ghost
 *         vec.u_nh_mh[0, 0] = vec.u_n[0, 0]
 *         vec.u_nh_mh[1, 0] = vec.u_n[1, 0]             # <<<<<<<<<<<<<<
 *         vec.u_nh_mh[0, siz-1] = vec.u_n[0, siz-1]
 *         vec.u_nh_mh[1, siz-1] = vec.u_n[1, siz-1]
 */
  __pyx_t_63 = 1;
  __pyx_t_64 = 0;
  __pyx_t_65 = 1;
  __pyx_t_66 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_65 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_66)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_63 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_64)) )));

  /* "pylsewave/cynum.pyx":2402
 *         vec.u_nh_mh[0, 0] = vec.u_n[0, 0]
 *         vec.u_nh_mh[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_mh[0, siz-1] = vec.u_n[0, siz-1]             # <<<<<<<<<<<<<<
 *         vec.u_nh_mh[1, siz-1] = vec.u_n[1, siz-1]
 *         vec.u_nh_ph[0, 0] = vec.u_n[0, 0]
 */
  __pyx_t_67 = 0;
  __pyx_t_68 = (__pyx_v_siz - 1);
  __pyx_t_69 = 0;
  __pyx_t_70 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_69 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_70)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_67 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_68)) )));

  /* "pylsewave/cynum.pyx":2403
 *         vec.u_nh_mh[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_mh[0, siz-1] = vec.u_n[0, siz-1]
 *         vec.u_nh_mh[1, siz-1] = vec.u_n[1, siz-1]             # <<<<<<<<<<<<<<
 *         vec.u_nh_ph[0, 0] = vec.u_n[0, 0]
 *         vec.u_nh_ph[1, 0] = vec.u_n[1, 0]
 */
  __pyx_t_71 = 1;
  __pyx_t_72 = (__pyx_v_siz - 1);
  __pyx_t_73 = 1;
  __pyx_t_74 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_73 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_74)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_71 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_72)) )));

  /* "pylsewave/cynum.pyx":2404
 *         vec.u_nh_mh[0, siz-1] = vec.u_n[0, siz-1]
 *         vec.u_nh_mh[1, siz-1] = vec.u_n[1, siz-1]
 *         vec.u_nh_ph[0, 0] = vec.u_n[0, 0]             # <<<<<<<<<<<<<<
 *         vec.u_nh_ph[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_ph[0, siz-1] = vec.u_n[0, siz-1]
 */
  __pyx_t_75 = 0;
  __pyx_t_76 = 0;
  __pyx_t_77 = 0;
  __pyx_t_78 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_77 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_78)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_75 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_76)) )));

  /* "pylsewave/cynum.pyx":2405
 *         vec.u_nh_mh[1, siz-1] = vec.u_n[1, siz-1]
 *         vec.u_nh_ph[0, 0] = vec.u_n[0, 0]
 *         vec.u_nh_ph[1, 0] = vec.u_n[1, 0]             # <<<<<<<<<<<<<<
 *         vec.u_nh_ph[0, siz-1] = vec.u_n[0, siz-1]
 *         vec.u_nh_ph[1, siz-1] = vec.u_n[1, siz-1]
 */
  __pyx_t_79 = 1;
  __pyx_t_80 = 0;
  __pyx_t_81 = 1;
  __pyx_t_82 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_81 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_82)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_79 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_80)) )));

  /* "pylsewave/cynum.pyx":2406
 *         vec.u_nh_ph[0, 0] = vec.u_n[0, 0]
 *         vec.u_nh_ph[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_ph[0, siz-1] = vec.u_n[0, siz-1]             # <<<<<<<<<<<<<<
 *         vec.u_nh_ph[1, siz-1] = vec.u_n[1, siz-1]
 * 
 */
  __pyx_t_83 = 0;
  __pyx_t_84 = (__pyx_v_siz - 1);
  __pyx_t_85 = 0;
  __pyx_t_86 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_85 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_86)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_83 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_84)) )));

  /* "pylsewave/cynum.pyx":2407
 *         vec.u_nh_ph[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_ph[0, siz-1] = vec.u_n[0, siz-1]
 *         vec.u_nh_ph[1, siz-1] = vec.u_n[1, siz-1]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_87 = 1;
  __pyx_t_88 = (__pyx_v_siz - 1);
  __pyx_t_89 = 1;
  __pyx_t_90 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_89 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_90)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_87 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_88)) )));

  /* "pylsewave/cynum.pyx":2410
 * 
 * 
 *         self._pdes.flux(vec.u_nh_mh, -1, vessel_index, vec.F_nh_mh)             # <<<<<<<<<<<<<<
 * 
 *         self._pdes.source(vec.u_nh_mh, -1, vessel_index, vec.S_nh_mh)
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->flux(__pyx_v_self->_pdes, __pyx_v_vec.u_nh_mh, -1, __pyx_v_vessel_index, __pyx_v_vec.F_nh_mh);

  /* "pylsewave/cynum.pyx":2412
 *         self._pdes.flux(vec.u_nh_mh, -1, vessel_index, vec.F_nh_mh)
 * 
 *         self._pdes.source(vec.u_nh_mh, -1, vessel_index, vec.S_nh_mh)             # <<<<<<<<<<<<<<
 * 
 *         self._pdes.flux(vec.u_nh_ph, 1, vessel_index, vec.F_nh_ph)
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->source(__pyx_v_self->_pdes, __pyx_v_vec.u_nh_mh, -1, __pyx_v_vessel_index, __pyx_v_vec.S_nh_mh);

  /* "pylsewave/cynum.pyx":2414
 *         self._pdes.source(vec.u_nh_mh, -1, vessel_index, vec.S_nh_mh)
 * 
 *         self._pdes.flux(vec.u_nh_ph, 1, vessel_index, vec.F_nh_ph)             # <<<<<<<<<<<<<<
 * 
 *         self._pdes.source(vec.u_nh_ph, 1, vessel_index, vec.S_nh_ph)
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->flux(__pyx_v_self->_pdes, __pyx_v_vec.u_nh_ph, 1, __pyx_v_vessel_index, __pyx_v_vec.F_nh_ph);

  /* "pylsewave/cynum.pyx":2416
 *         self._pdes.flux(vec.u_nh_ph, 1, vessel_index, vec.F_nh_ph)
 * 
 *         self._pdes.source(vec.u_nh_ph, 1, vessel_index, vec.S_nh_ph)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->_pdes->__pyx_vtab)->source(__pyx_v_self->_pdes, __pyx_v_vec.u_nh_ph, 1, __pyx_v_vessel_index, __pyx_v_vec.S_nh_ph);

  /* "pylsewave/cynum.pyx":2419
 * 
 * 
 *         for i in range(1, siz-1):             # <<<<<<<<<<<<<<
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 */
  __pyx_t_1 = (__pyx_v_siz - 1);
  for (__pyx_t_2 = 1; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2420
 * 
 *         for i in range(1, siz-1):
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +             # <<<<<<<<<<<<<<
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +
 */
    __pyx_t_91 = 0;
    __pyx_t_92 = __pyx_v_i;
    __pyx_t_93 = 0;
    __pyx_t_94 = __pyx_v_i;
    __pyx_t_95 = 0;
    __pyx_t_96 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2421
 *         for i in range(1, siz-1):
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))             # <<<<<<<<<<<<<<
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +
 *                            dt2*(vec.S_nh_ph[1, i] + vec.S_nh_mh[1, i]))
 */
    __pyx_t_97 = 0;
    __pyx_t_98 = __pyx_v_i;
    __pyx_t_99 = 0;
    __pyx_t_100 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2420
 * 
 *         for i in range(1, siz-1):
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +             # <<<<<<<<<<<<<<
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +
 */
    __pyx_t_101 = 0;
    __pyx_t_102 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u.data + __pyx_t_101 * __pyx_v_vec.u.strides[0]) )) + __pyx_t_102)) )) = (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_91 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_92)) ))) - (__pyx_v_theta * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_nh_ph.data + __pyx_t_93 * __pyx_v_vec.F_nh_ph.strides[0]) )) + __pyx_t_94)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_nh_mh.data + __pyx_t_95 * __pyx_v_vec.F_nh_mh.strides[0]) )) + __pyx_t_96)) )))))) + (__pyx_v_dt2 * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_nh_ph.data + __pyx_t_97 * __pyx_v_vec.S_nh_ph.strides[0]) )) + __pyx_t_98)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_nh_mh.data + __pyx_t_99 * __pyx_v_vec.S_nh_mh.strides[0]) )) + __pyx_t_100)) ))))));

    /* "pylsewave/cynum.pyx":2422
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +             # <<<<<<<<<<<<<<
 *                            dt2*(vec.S_nh_ph[1, i] + vec.S_nh_mh[1, i]))
 * 
 */
    __pyx_t_103 = 1;
    __pyx_t_104 = __pyx_v_i;
    __pyx_t_105 = 1;
    __pyx_t_106 = __pyx_v_i;
    __pyx_t_107 = 1;
    __pyx_t_108 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2423
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +
 *                            dt2*(vec.S_nh_ph[1, i] + vec.S_nh_mh[1, i]))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_109 = 1;
    __pyx_t_110 = __pyx_v_i;
    __pyx_t_111 = 1;
    __pyx_t_112 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2422
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +             # <<<<<<<<<<<<<<
 *                            dt2*(vec.S_nh_ph[1, i] + vec.S_nh_mh[1, i]))
 * 
 */
    __pyx_t_113 = 1;
    __pyx_t_114 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u.data + __pyx_t_113 * __pyx_v_vec.u.strides[0]) )) + __pyx_t_114)) )) = (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_103 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_104)) ))) - (__pyx_v_theta * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_nh_ph.data + __pyx_t_105 * __pyx_v_vec.F_nh_ph.strides[0]) )) + __pyx_t_106)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_nh_mh.data + __pyx_t_107 * __pyx_v_vec.F_nh_mh.strides[0]) )) + __pyx_t_108)) )))))) + (__pyx_v_dt2 * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_nh_ph.data + __pyx_t_109 * __pyx_v_vec.S_nh_ph.strides[0]) )) + __pyx_t_110)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_nh_mh.data + __pyx_t_111 * __pyx_v_vec.S_nh_mh.strides[0]) )) + __pyx_t_112)) ))))));
  }

  /* "pylsewave/cynum.pyx":2366
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef void advance(self, U vec, double dt, double dx, int vessel_index) nogil:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t siz
 *         cdef Py_ssize_t i, j
 */

  /* function exit code */
}

/* "pylsewave/cynum.pyx":2451
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef void advance(self, U vec, double dt, double dx, int vessel_index) nogil:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t siz
 *         cdef Py_ssize_t i, j
 */

static void __pyx_f_9pylsewave_5cynum_18cLaxWendroffSolver_advance(struct __pyx_obj_9pylsewave_5cynum_cLaxWendroffSolver *__pyx_v_self, struct __pyx_t_9pylsewave_5cynum_U __pyx_v_vec, double __pyx_v_dt, double __pyx_v_dx, int __pyx_v_vessel_index) {
  Py_ssize_t __pyx_v_siz;
  Py_ssize_t __pyx_v_i;
  double __pyx_v_dt2;
  double __pyx_v_theta;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  Py_ssize_t __pyx_t_64;
  Py_ssize_t __pyx_t_65;
  Py_ssize_t __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  Py_ssize_t __pyx_t_70;
  Py_ssize_t __pyx_t_71;
  Py_ssize_t __pyx_t_72;
  Py_ssize_t __pyx_t_73;
  Py_ssize_t __pyx_t_74;
  Py_ssize_t __pyx_t_75;
  Py_ssize_t __pyx_t_76;
  Py_ssize_t __pyx_t_77;
  Py_ssize_t __pyx_t_78;
  Py_ssize_t __pyx_t_79;
  Py_ssize_t __pyx_t_80;
  Py_ssize_t __pyx_t_81;
  Py_ssize_t __pyx_t_82;
  Py_ssize_t __pyx_t_83;
  Py_ssize_t __pyx_t_84;
  Py_ssize_t __pyx_t_85;
  Py_ssize_t __pyx_t_86;
  Py_ssize_t __pyx_t_87;
  Py_ssize_t __pyx_t_88;
  Py_ssize_t __pyx_t_89;
  Py_ssize_t __pyx_t_90;
  Py_ssize_t __pyx_t_91;
  Py_ssize_t __pyx_t_92;
  Py_ssize_t __pyx_t_93;
  Py_ssize_t __pyx_t_94;
  Py_ssize_t __pyx_t_95;
  Py_ssize_t __pyx_t_96;
  Py_ssize_t __pyx_t_97;
  Py_ssize_t __pyx_t_98;
  Py_ssize_t __pyx_t_99;
  Py_ssize_t __pyx_t_100;
  Py_ssize_t __pyx_t_101;
  Py_ssize_t __pyx_t_102;
  Py_ssize_t __pyx_t_103;
  Py_ssize_t __pyx_t_104;
  Py_ssize_t __pyx_t_105;
  Py_ssize_t __pyx_t_106;
  Py_ssize_t __pyx_t_107;
  Py_ssize_t __pyx_t_108;
  Py_ssize_t __pyx_t_109;
  Py_ssize_t __pyx_t_110;
  Py_ssize_t __pyx_t_111;
  Py_ssize_t __pyx_t_112;
  Py_ssize_t __pyx_t_113;
  Py_ssize_t __pyx_t_114;

  /* "pylsewave/cynum.pyx":2457
 *         cdef double dt2, theta
 * 
 *         siz = vec.x_size             # <<<<<<<<<<<<<<
 * 
 *         dt2 = dt/2.
 */
  __pyx_t_1 = __pyx_v_vec.x_size;
  __pyx_v_siz = __pyx_t_1;

  /* "pylsewave/cynum.pyx":2459
 *         siz = vec.x_size
 * 
 *         dt2 = dt/2.             # <<<<<<<<<<<<<<
 * 
 *         theta = dt / dx
 */
  __pyx_v_dt2 = (__pyx_v_dt / 2.);

  /* "pylsewave/cynum.pyx":2461
 *         dt2 = dt/2.
 * 
 *         theta = dt / dx             # <<<<<<<<<<<<<<
 * 
 *         self._pdes.flux(vec.u_n, 0, vessel_index, vec.F_)
 */
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":2463
 *         theta = dt / dx
 * 
 *         self._pdes.flux(vec.u_n, 0, vessel_index, vec.F_)             # <<<<<<<<<<<<<<
 *         self._pdes.source(vec.u_n, 0, vessel_index, vec.S_)
 * 
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base._pdes->__pyx_vtab)->flux(__pyx_v_self->__pyx_base._pdes, __pyx_v_vec.u_n, 0, __pyx_v_vessel_index, __pyx_v_vec.F_);

  /* "pylsewave/cynum.pyx":2464
 * 
 *         self._pdes.flux(vec.u_n, 0, vessel_index, vec.F_)
 *         self._pdes.source(vec.u_n, 0, vessel_index, vec.S_)             # <<<<<<<<<<<<<<
 * 
 * #         # U[n+1/2, i-1/2]
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base._pdes->__pyx_vtab)->source(__pyx_v_self->__pyx_base._pdes, __pyx_v_vec.u_n, 0, __pyx_v_vessel_index, __pyx_v_vec.S_);

  /* "pylsewave/cynum.pyx":2468
 * #         # U[n+1/2, i-1/2]
 * #         with nogil, parallel(num_threads=4):
 *         for i in range(1, vec.x_size-1):             # <<<<<<<<<<<<<<
 *             vec.u_nh_mh[0, i] = ((vec.u_n[0, i] + vec.u_n[0, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 */
  __pyx_t_1 = (__pyx_v_vec.x_size - 1);
  for (__pyx_t_2 = 1; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2469
 * #         with nogil, parallel(num_threads=4):
 *         for i in range(1, vec.x_size-1):
 *             vec.u_nh_mh[0, i] = ((vec.u_n[0, i] + vec.u_n[0, i-1]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 */
    __pyx_t_3 = 0;
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = 0;
    __pyx_t_6 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2470
 *         for i in range(1, vec.x_size-1):
 *             vec.u_nh_mh[0, i] = ((vec.u_n[0, i] + vec.u_n[0, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +             # <<<<<<<<<<<<<<
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -
 */
    __pyx_t_7 = 0;
    __pyx_t_8 = __pyx_v_i;
    __pyx_t_9 = 0;
    __pyx_t_10 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2471
 *             vec.u_nh_mh[0, i] = ((vec.u_n[0, i] + vec.u_n[0, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))             # <<<<<<<<<<<<<<
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i] - vec.F_[1, i-1]) +
 */
    __pyx_t_11 = 0;
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = 0;
    __pyx_t_14 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2469
 * #         with nogil, parallel(num_threads=4):
 *         for i in range(1, vec.x_size-1):
 *             vec.u_nh_mh[0, i] = ((vec.u_n[0, i] + vec.u_n[0, i-1]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 */
    __pyx_t_15 = 0;
    __pyx_t_16 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_15 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_16)) )) = (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_3 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_4)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_5 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_6)) )))) / 2.) - ((0.5 * __pyx_v_theta) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_7 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_8)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_9 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_10)) )))))) + ((0.5 * __pyx_v_dt2) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_11 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_12)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_13 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_14)) ))))));

    /* "pylsewave/cynum.pyx":2472
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[1, i] - vec.F_[1, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))
 */
    __pyx_t_17 = 1;
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_19 = 1;
    __pyx_t_20 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2473
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i] - vec.F_[1, i-1]) +             # <<<<<<<<<<<<<<
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))
 * 
 */
    __pyx_t_21 = 1;
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_23 = 1;
    __pyx_t_24 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2474
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i] - vec.F_[1, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))             # <<<<<<<<<<<<<<
 * 
 *             vec.u_nh_ph[0, i] = ((vec.u_n[0, i+1] + vec.u_n[0, i]) / 2. -
 */
    __pyx_t_25 = 1;
    __pyx_t_26 = __pyx_v_i;
    __pyx_t_27 = 1;
    __pyx_t_28 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2472
 *                                  0.5 * (theta) * (vec.F_[0, i] - vec.F_[0, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[0, i] + vec.S_[0, i-1]))
 *             vec.u_nh_mh[1, i] = ((vec.u_n[1, i] + vec.u_n[1, i-1]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[1, i] - vec.F_[1, i-1]) +
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))
 */
    __pyx_t_29 = 1;
    __pyx_t_30 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_29 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_30)) )) = (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_17 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_18)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_19 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_20)) )))) / 2.) - ((0.5 * __pyx_v_theta) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_21 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_22)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_23 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_24)) )))))) + ((0.5 * __pyx_v_dt2) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_25 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_26)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_27 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_28)) ))))));

    /* "pylsewave/cynum.pyx":2476
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))
 * 
 *             vec.u_nh_ph[0, i] = ((vec.u_n[0, i+1] + vec.u_n[0, i]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 */
    __pyx_t_31 = 0;
    __pyx_t_32 = (__pyx_v_i + 1);
    __pyx_t_33 = 0;
    __pyx_t_34 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2477
 * 
 *             vec.u_nh_ph[0, i] = ((vec.u_n[0, i+1] + vec.u_n[0, i]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +             # <<<<<<<<<<<<<<
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -
 */
    __pyx_t_35 = 0;
    __pyx_t_36 = (__pyx_v_i + 1);
    __pyx_t_37 = 0;
    __pyx_t_38 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2478
 *             vec.u_nh_ph[0, i] = ((vec.u_n[0, i+1] + vec.u_n[0, i]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))             # <<<<<<<<<<<<<<
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i+1] - vec.F_[1, i]) +
 */
    __pyx_t_39 = 0;
    __pyx_t_40 = (__pyx_v_i + 1);
    __pyx_t_41 = 0;
    __pyx_t_42 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2476
 *                                  0.5 * dt2 * (vec.S_[1, i] + vec.S_[1, i-1]))
 * 
 *             vec.u_nh_ph[0, i] = ((vec.u_n[0, i+1] + vec.u_n[0, i]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 */
    __pyx_t_43 = 0;
    __pyx_t_44 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_43 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_44)) )) = (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_31 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_32)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_33 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_34)) )))) / 2.) - ((0.5 * __pyx_v_theta) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_35 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_36)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_37 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_38)) )))))) + ((0.5 * __pyx_v_dt2) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_39 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_40)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_41 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_42)) ))))));

    /* "pylsewave/cynum.pyx":2479
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[1, i+1] - vec.F_[1, i]) +
 *                                  0.5 * dt2 * (vec.S_[1, i+1] + vec.S_[1, i]))
 */
    __pyx_t_45 = 1;
    __pyx_t_46 = (__pyx_v_i + 1);
    __pyx_t_47 = 1;
    __pyx_t_48 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2480
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i+1] - vec.F_[1, i]) +             # <<<<<<<<<<<<<<
 *                                  0.5 * dt2 * (vec.S_[1, i+1] + vec.S_[1, i]))
 * 
 */
    __pyx_t_49 = 1;
    __pyx_t_50 = (__pyx_v_i + 1);
    __pyx_t_51 = 1;
    __pyx_t_52 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2481
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -
 *                                  0.5 * (theta) * (vec.F_[1, i+1] - vec.F_[1, i]) +
 *                                  0.5 * dt2 * (vec.S_[1, i+1] + vec.S_[1, i]))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_53 = 1;
    __pyx_t_54 = (__pyx_v_i + 1);
    __pyx_t_55 = 1;
    __pyx_t_56 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2479
 *                                  0.5 * (theta) * (vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                  0.5 * dt2 * (vec.S_[0, i+1] + vec.S_[0, i]))
 *             vec.u_nh_ph[1, i] = ((vec.u_n[1, i+1] + vec.u_n[1, i]) / 2. -             # <<<<<<<<<<<<<<
 *                                  0.5 * (theta) * (vec.F_[1, i+1] - vec.F_[1, i]) +
 *                                  0.5 * dt2 * (vec.S_[1, i+1] + vec.S_[1, i]))
 */
    __pyx_t_57 = 1;
    __pyx_t_58 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_57 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_58)) )) = (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_45 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_46)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_47 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_48)) )))) / 2.) - ((0.5 * __pyx_v_theta) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_49 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_50)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_51 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_52)) )))))) + ((0.5 * __pyx_v_dt2) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_53 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_54)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_55 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_56)) ))))));
  }

  /* "pylsewave/cynum.pyx":2485
 * 
 *         # this is a test, because we need to fill the edges with ghost
 *         vec.u_nh_mh[0, 0] = vec.u_n[0, 0]             # <<<<<<<<<<<<<<
 *         vec.u_nh_mh[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_mh[0, siz-1] = vec.u_n[0, siz-1]
 */
  __pyx_t_59 = 0;
  __pyx_t_60 = 0;
  __pyx_t_61 = 0;
  __pyx_t_62 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_61 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_62)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_59 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_60)) )));

  /* "pylsewave/cynum.pyx":2486
 *         # this is a test, because we need to fill the edges with ghost
 *         vec.u_nh_mh[0, 0] = vec.u_n[0, 0]
 *         vec.u_nh_mh[1, 0] = vec.u_n[1, 0]             # <<<<<<<<<<<<<<
 *         vec.u_nh_mh[0, siz-1] = vec.u_n[0, siz-1]
 *         vec.u_nh_mh[1, siz-1] = vec.u_n[1, siz-1]
 */
  __pyx_t_63 = 1;
  __pyx_t_64 = 0;
  __pyx_t_65 = 1;
  __pyx_t_66 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_65 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_66)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_63 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_64)) )));

  /* "pylsewave/cynum.pyx":2487
 *         vec.u_nh_mh[0, 0] = vec.u_n[0, 0]
 *         vec.u_nh_mh[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_mh[0, siz-1] = vec.u_n[0, siz-1]             # <<<<<<<<<<<<<<
 *         vec.u_nh_mh[1, siz-1] = vec.u_n[1, siz-1]
 *         vec.u_nh_ph[0, 0] = vec.u_n[0, 0]
 */
  __pyx_t_67 = 0;
  __pyx_t_68 = (__pyx_v_siz - 1);
  __pyx_t_69 = 0;
  __pyx_t_70 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_69 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_70)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_67 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_68)) )));

  /* "pylsewave/cynum.pyx":2488
 *         vec.u_nh_mh[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_mh[0, siz-1] = vec.u_n[0, siz-1]
 *         vec.u_nh_mh[1, siz-1] = vec.u_n[1, siz-1]             # <<<<<<<<<<<<<<
 *         vec.u_nh_ph[0, 0] = vec.u_n[0, 0]
 *         vec.u_nh_ph[1, 0] = vec.u_n[1, 0]
 */
  __pyx_t_71 = 1;
  __pyx_t_72 = (__pyx_v_siz - 1);
  __pyx_t_73 = 1;
  __pyx_t_74 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_mh.data + __pyx_t_73 * __pyx_v_vec.u_nh_mh.strides[0]) )) + __pyx_t_74)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_71 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_72)) )));

  /* "pylsewave/cynum.pyx":2489
 *         vec.u_nh_mh[0, siz-1] = vec.u_n[0, siz-1]
 *         vec.u_nh_mh[1, siz-1] = vec.u_n[1, siz-1]
 *         vec.u_nh_ph[0, 0] = vec.u_n[0, 0]             # <<<<<<<<<<<<<<
 *         vec.u_nh_ph[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_ph[0, siz-1] = vec.u_n[0, siz-1]
 */
  __pyx_t_75 = 0;
  __pyx_t_76 = 0;
  __pyx_t_77 = 0;
  __pyx_t_78 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_77 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_78)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_75 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_76)) )));

  /* "pylsewave/cynum.pyx":2490
 *         vec.u_nh_mh[1, siz-1] = vec.u_n[1, siz-1]
 *         vec.u_nh_ph[0, 0] = vec.u_n[0, 0]
 *         vec.u_nh_ph[1, 0] = vec.u_n[1, 0]             # <<<<<<<<<<<<<<
 *         vec.u_nh_ph[0, siz-1] = vec.u_n[0, siz-1]
 *         vec.u_nh_ph[1, siz-1] = vec.u_n[1, siz-1]
 */
  __pyx_t_79 = 1;
  __pyx_t_80 = 0;
  __pyx_t_81 = 1;
  __pyx_t_82 = 0;
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_81 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_82)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_79 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_80)) )));

  /* "pylsewave/cynum.pyx":2491
 *         vec.u_nh_ph[0, 0] = vec.u_n[0, 0]
 *         vec.u_nh_ph[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_ph[0, siz-1] = vec.u_n[0, siz-1]             # <<<<<<<<<<<<<<
 *         vec.u_nh_ph[1, siz-1] = vec.u_n[1, siz-1]
 * 
 */
  __pyx_t_83 = 0;
  __pyx_t_84 = (__pyx_v_siz - 1);
  __pyx_t_85 = 0;
  __pyx_t_86 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_85 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_86)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_83 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_84)) )));

  /* "pylsewave/cynum.pyx":2492
 *         vec.u_nh_ph[1, 0] = vec.u_n[1, 0]
 *         vec.u_nh_ph[0, siz-1] = vec.u_n[0, siz-1]
 *         vec.u_nh_ph[1, siz-1] = vec.u_n[1, siz-1]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_87 = 1;
  __pyx_t_88 = (__pyx_v_siz - 1);
  __pyx_t_89 = 1;
  __pyx_t_90 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_nh_ph.data + __pyx_t_89 * __pyx_v_vec.u_nh_ph.strides[0]) )) + __pyx_t_90)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_87 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_88)) )));

  /* "pylsewave/cynum.pyx":2495
 * 
 * 
 *         self._pdes.flux(vec.u_nh_mh, -1, vessel_index, vec.F_nh_mh)             # <<<<<<<<<<<<<<
 * 
 *         self._pdes.source(vec.u_nh_mh, -1, vessel_index, vec.S_nh_mh)
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base._pdes->__pyx_vtab)->flux(__pyx_v_self->__pyx_base._pdes, __pyx_v_vec.u_nh_mh, -1, __pyx_v_vessel_index, __pyx_v_vec.F_nh_mh);

  /* "pylsewave/cynum.pyx":2497
 *         self._pdes.flux(vec.u_nh_mh, -1, vessel_index, vec.F_nh_mh)
 * 
 *         self._pdes.source(vec.u_nh_mh, -1, vessel_index, vec.S_nh_mh)             # <<<<<<<<<<<<<<
 * 
 *         self._pdes.flux(vec.u_nh_ph, 1, vessel_index, vec.F_nh_ph)
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base._pdes->__pyx_vtab)->source(__pyx_v_self->__pyx_base._pdes, __pyx_v_vec.u_nh_mh, -1, __pyx_v_vessel_index, __pyx_v_vec.S_nh_mh);

  /* "pylsewave/cynum.pyx":2499
 *         self._pdes.source(vec.u_nh_mh, -1, vessel_index, vec.S_nh_mh)
 * 
 *         self._pdes.flux(vec.u_nh_ph, 1, vessel_index, vec.F_nh_ph)             # <<<<<<<<<<<<<<
 * 
 *         self._pdes.source(vec.u_nh_ph, 1, vessel_index, vec.S_nh_ph)
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base._pdes->__pyx_vtab)->flux(__pyx_v_self->__pyx_base._pdes, __pyx_v_vec.u_nh_ph, 1, __pyx_v_vessel_index, __pyx_v_vec.F_nh_ph);

  /* "pylsewave/cynum.pyx":2501
 *         self._pdes.flux(vec.u_nh_ph, 1, vessel_index, vec.F_nh_ph)
 * 
 *         self._pdes.source(vec.u_nh_ph, 1, vessel_index, vec.S_nh_ph)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(1, siz-1):
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base._pdes->__pyx_vtab)->source(__pyx_v_self->__pyx_base._pdes, __pyx_v_vec.u_nh_ph, 1, __pyx_v_vessel_index, __pyx_v_vec.S_nh_ph);

  /* "pylsewave/cynum.pyx":2503
 *         self._pdes.source(vec.u_nh_ph, 1, vessel_index, vec.S_nh_ph)
 * 
 *         for i in range(1, siz-1):             # <<<<<<<<<<<<<<
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 */
  __pyx_t_1 = (__pyx_v_siz - 1);
  for (__pyx_t_2 = 1; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2504
 * 
 *         for i in range(1, siz-1):
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +             # <<<<<<<<<<<<<<
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +
 */
    __pyx_t_91 = 0;
    __pyx_t_92 = __pyx_v_i;
    __pyx_t_93 = 0;
    __pyx_t_94 = __pyx_v_i;
    __pyx_t_95 = 0;
    __pyx_t_96 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2505
 *         for i in range(1, siz-1):
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))             # <<<<<<<<<<<<<<
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +
 *                            dt2*(vec.S_nh_ph[1, i] + vec.S_nh_mh[1, i]))
 */
    __pyx_t_97 = 0;
    __pyx_t_98 = __pyx_v_i;
    __pyx_t_99 = 0;
    __pyx_t_100 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2504
 * 
 *         for i in range(1, siz-1):
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +             # <<<<<<<<<<<<<<
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +
 */
    __pyx_t_101 = 0;
    __pyx_t_102 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u.data + __pyx_t_101 * __pyx_v_vec.u.strides[0]) )) + __pyx_t_102)) )) = (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_91 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_92)) ))) - (__pyx_v_theta * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_nh_ph.data + __pyx_t_93 * __pyx_v_vec.F_nh_ph.strides[0]) )) + __pyx_t_94)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_nh_mh.data + __pyx_t_95 * __pyx_v_vec.F_nh_mh.strides[0]) )) + __pyx_t_96)) )))))) + (__pyx_v_dt2 * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_nh_ph.data + __pyx_t_97 * __pyx_v_vec.S_nh_ph.strides[0]) )) + __pyx_t_98)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_nh_mh.data + __pyx_t_99 * __pyx_v_vec.S_nh_mh.strides[0]) )) + __pyx_t_100)) ))))));

    /* "pylsewave/cynum.pyx":2506
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +             # <<<<<<<<<<<<<<
 *                            dt2*(vec.S_nh_ph[1, i] + vec.S_nh_mh[1, i]))
 * 
 */
    __pyx_t_103 = 1;
    __pyx_t_104 = __pyx_v_i;
    __pyx_t_105 = 1;
    __pyx_t_106 = __pyx_v_i;
    __pyx_t_107 = 1;
    __pyx_t_108 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2507
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +
 *                            dt2*(vec.S_nh_ph[1, i] + vec.S_nh_mh[1, i]))             # <<<<<<<<<<<<<<
 * 
 * cdef class cMacCormackSolver(cFDMSolver):
 */
    __pyx_t_109 = 1;
    __pyx_t_110 = __pyx_v_i;
    __pyx_t_111 = 1;
    __pyx_t_112 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2506
 *             vec.u[0, i] = (vec.u_n[0, i] - theta * (vec.F_nh_ph[0, i] - vec.F_nh_mh[0, i]) +
 *                            dt2*(vec.S_nh_ph[0, i] + vec.S_nh_mh[0, i]))
 *             vec.u[1, i] = (vec.u_n[1, i] - theta * (vec.F_nh_ph[1, i] - vec.F_nh_mh[1, i]) +             # <<<<<<<<<<<<<<
 *                            dt2*(vec.S_nh_ph[1, i] + vec.S_nh_mh[1, i]))
 * 
 */
    __pyx_t_113 = 1;
    __pyx_t_114 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u.data + __pyx_t_113 * __pyx_v_vec.u.strides[0]) )) + __pyx_t_114)) )) = (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_103 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_104)) ))) - (__pyx_v_theta * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_nh_ph.data + __pyx_t_105 * __pyx_v_vec.F_nh_ph.strides[0]) )) + __pyx_t_106)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_nh_mh.data + __pyx_t_107 * __pyx_v_vec.F_nh_mh.strides[0]) )) + __pyx_t_108)) )))))) + (__pyx_v_dt2 * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_nh_ph.data + __pyx_t_109 * __pyx_v_vec.S_nh_ph.strides[0]) )) + __pyx_t_110)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_nh_mh.data + __pyx_t_111 * __pyx_v_vec.S_nh_mh.strides[0]) )) + __pyx_t_112)) ))))));
  }

  /* "pylsewave/cynum.pyx":2451
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef void advance(self, U vec, double dt, double dx, int vessel_index) nogil:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t siz
 *         cdef Py_ssize_t i, j
 */

  /* function exit code */
}

/* "pylsewave/cynum.pyx":2533
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef void advance(self, U vec, double dt, double dx, int vessel_index) nogil:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t siz
 *         cdef Py_ssize_t i, j
 */

static void __pyx_f_9pylsewave_5cynum_17cMacCormackSolver_advance(struct __pyx_obj_9pylsewave_5cynum_cMacCormackSolver *__pyx_v_self, struct __pyx_t_9pylsewave_5cynum_U __pyx_v_vec, double __pyx_v_dt, double __pyx_v_dx, int __pyx_v_vessel_index) {
  Py_ssize_t __pyx_v_siz;
  Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED double __pyx_v_dt2;
  double __pyx_v_theta;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  Py_ssize_t __pyx_t_64;
  Py_ssize_t __pyx_t_65;
  Py_ssize_t __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  Py_ssize_t __pyx_t_70;
  Py_ssize_t __pyx_t_71;
  Py_ssize_t __pyx_t_72;
  Py_ssize_t __pyx_t_73;
  Py_ssize_t __pyx_t_74;

  /* "pylsewave/cynum.pyx":2539
 *         cdef double dt2, theta
 * 
 *         siz = vec.x_size             # <<<<<<<<<<<<<<
 * 
 *         dt2 = 0.5*dt
 */
  __pyx_t_1 = __pyx_v_vec.x_size;
  __pyx_v_siz = __pyx_t_1;

  /* "pylsewave/cynum.pyx":2541
 *         siz = vec.x_size
 * 
 *         dt2 = 0.5*dt             # <<<<<<<<<<<<<<
 * 
 *         theta = dt / dx
 */
  __pyx_v_dt2 = (0.5 * __pyx_v_dt);

  /* "pylsewave/cynum.pyx":2543
 *         dt2 = 0.5*dt
 * 
 *         theta = dt / dx             # <<<<<<<<<<<<<<
 * 
 *         self._pdes.flux(vec.u_n, 0, vessel_index, vec.F_)
 */
  __pyx_v_theta = (__pyx_v_dt / __pyx_v_dx);

  /* "pylsewave/cynum.pyx":2545
 *         theta = dt / dx
 * 
 *         self._pdes.flux(vec.u_n, 0, vessel_index, vec.F_)             # <<<<<<<<<<<<<<
 *         self._pdes.source(vec.u_n, 0, vessel_index, vec.S_)
 * 
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base._pdes->__pyx_vtab)->flux(__pyx_v_self->__pyx_base._pdes, __pyx_v_vec.u_n, 0, __pyx_v_vessel_index, __pyx_v_vec.F_);

  /* "pylsewave/cynum.pyx":2546
 * 
 *         self._pdes.flux(vec.u_n, 0, vessel_index, vec.F_)
 *         self._pdes.source(vec.u_n, 0, vessel_index, vec.S_)             # <<<<<<<<<<<<<<
 * 
 * #         # U[n+1/2, i-1/2]
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base._pdes->__pyx_vtab)->source(__pyx_v_self->__pyx_base._pdes, __pyx_v_vec.u_n, 0, __pyx_v_vessel_index, __pyx_v_vec.S_);

  /* "pylsewave/cynum.pyx":2550
 * #         # U[n+1/2, i-1/2]
 * #         with nogil, parallel(num_threads=4):
 *         for i in range(0, siz-1):             # <<<<<<<<<<<<<<
 *             vec.u_star[0, i] = (vec.u_n[0, i] - theta*(vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                 dt*vec.S_[0, i])
 */
  __pyx_t_1 = (__pyx_v_siz - 1);
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2551
 * #         with nogil, parallel(num_threads=4):
 *         for i in range(0, siz-1):
 *             vec.u_star[0, i] = (vec.u_n[0, i] - theta*(vec.F_[0, i+1] - vec.F_[0, i]) +             # <<<<<<<<<<<<<<
 *                                 dt*vec.S_[0, i])
 *             vec.u_star[1, i] = (vec.u_n[1, i] - theta*(vec.F_[1, i+1] - vec.F_[1, i]) +
 */
    __pyx_t_3 = 0;
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = 0;
    __pyx_t_6 = (__pyx_v_i + 1);
    __pyx_t_7 = 0;
    __pyx_t_8 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2552
 *         for i in range(0, siz-1):
 *             vec.u_star[0, i] = (vec.u_n[0, i] - theta*(vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                 dt*vec.S_[0, i])             # <<<<<<<<<<<<<<
 *             vec.u_star[1, i] = (vec.u_n[1, i] - theta*(vec.F_[1, i+1] - vec.F_[1, i]) +
 *                                 dt*vec.S_[1, i])
 */
    __pyx_t_9 = 0;
    __pyx_t_10 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2551
 * #         with nogil, parallel(num_threads=4):
 *         for i in range(0, siz-1):
 *             vec.u_star[0, i] = (vec.u_n[0, i] - theta*(vec.F_[0, i+1] - vec.F_[0, i]) +             # <<<<<<<<<<<<<<
 *                                 dt*vec.S_[0, i])
 *             vec.u_star[1, i] = (vec.u_n[1, i] - theta*(vec.F_[1, i+1] - vec.F_[1, i]) +
 */
    __pyx_t_11 = 0;
    __pyx_t_12 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_star.data + __pyx_t_11 * __pyx_v_vec.u_star.strides[0]) )) + __pyx_t_12)) )) = (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_3 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_4)) ))) - (__pyx_v_theta * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_5 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_6)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_7 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_8)) )))))) + (__pyx_v_dt * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_9 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_10)) )))));

    /* "pylsewave/cynum.pyx":2553
 *             vec.u_star[0, i] = (vec.u_n[0, i] - theta*(vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                 dt*vec.S_[0, i])
 *             vec.u_star[1, i] = (vec.u_n[1, i] - theta*(vec.F_[1, i+1] - vec.F_[1, i]) +             # <<<<<<<<<<<<<<
 *                                 dt*vec.S_[1, i])
 * 
 */
    __pyx_t_13 = 1;
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_15 = 1;
    __pyx_t_16 = (__pyx_v_i + 1);
    __pyx_t_17 = 1;
    __pyx_t_18 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2554
 *                                 dt*vec.S_[0, i])
 *             vec.u_star[1, i] = (vec.u_n[1, i] - theta*(vec.F_[1, i+1] - vec.F_[1, i]) +
 *                                 dt*vec.S_[1, i])             # <<<<<<<<<<<<<<
 * 
 *         # vec.u_star[0, 0] = vec.u_n[0, 0]
 */
    __pyx_t_19 = 1;
    __pyx_t_20 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2553
 *             vec.u_star[0, i] = (vec.u_n[0, i] - theta*(vec.F_[0, i+1] - vec.F_[0, i]) +
 *                                 dt*vec.S_[0, i])
 *             vec.u_star[1, i] = (vec.u_n[1, i] - theta*(vec.F_[1, i+1] - vec.F_[1, i]) +             # <<<<<<<<<<<<<<
 *                                 dt*vec.S_[1, i])
 * 
 */
    __pyx_t_21 = 1;
    __pyx_t_22 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_star.data + __pyx_t_21 * __pyx_v_vec.u_star.strides[0]) )) + __pyx_t_22)) )) = (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_13 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_14)) ))) - (__pyx_v_theta * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_15 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_16)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_17 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_18)) )))))) + (__pyx_v_dt * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_19 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_20)) )))));
  }

  /* "pylsewave/cynum.pyx":2558
 *         # vec.u_star[0, 0] = vec.u_n[0, 0]
 *         # vec.u_star[1, 0] = vec.u_n[1, 0]
 *         vec.u_star[0, siz-1] = vec.u_n[0, siz-1]             # <<<<<<<<<<<<<<
 *         vec.u_star[1, siz-1] = vec.u_n[1, siz-1]
 * 
 */
  __pyx_t_23 = 0;
  __pyx_t_24 = (__pyx_v_siz - 1);
  __pyx_t_25 = 0;
  __pyx_t_26 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_star.data + __pyx_t_25 * __pyx_v_vec.u_star.strides[0]) )) + __pyx_t_26)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_23 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_24)) )));

  /* "pylsewave/cynum.pyx":2559
 *         # vec.u_star[1, 0] = vec.u_n[1, 0]
 *         vec.u_star[0, siz-1] = vec.u_n[0, siz-1]
 *         vec.u_star[1, siz-1] = vec.u_n[1, siz-1]             # <<<<<<<<<<<<<<
 * 
 *         vec.u_star[0, siz-1] = (vec.u_n[0, siz-1] - theta*(vec.F_[0, siz-2] - vec.F_[0, siz-1]) +
 */
  __pyx_t_27 = 1;
  __pyx_t_28 = (__pyx_v_siz - 1);
  __pyx_t_29 = 1;
  __pyx_t_30 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_star.data + __pyx_t_29 * __pyx_v_vec.u_star.strides[0]) )) + __pyx_t_30)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_27 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_28)) )));

  /* "pylsewave/cynum.pyx":2561
 *         vec.u_star[1, siz-1] = vec.u_n[1, siz-1]
 * 
 *         vec.u_star[0, siz-1] = (vec.u_n[0, siz-1] - theta*(vec.F_[0, siz-2] - vec.F_[0, siz-1]) +             # <<<<<<<<<<<<<<
 *                                 dt*vec.S_[0, siz-1])
 *         vec.u_star[1, siz-1] = (vec.u_n[1, siz-1] - theta*(vec.F_[1, siz-2] - vec.F_[1, siz-1]) +
 */
  __pyx_t_31 = 0;
  __pyx_t_32 = (__pyx_v_siz - 1);
  __pyx_t_33 = 0;
  __pyx_t_34 = (__pyx_v_siz - 2);
  __pyx_t_35 = 0;
  __pyx_t_36 = (__pyx_v_siz - 1);

  /* "pylsewave/cynum.pyx":2562
 * 
 *         vec.u_star[0, siz-1] = (vec.u_n[0, siz-1] - theta*(vec.F_[0, siz-2] - vec.F_[0, siz-1]) +
 *                                 dt*vec.S_[0, siz-1])             # <<<<<<<<<<<<<<
 *         vec.u_star[1, siz-1] = (vec.u_n[1, siz-1] - theta*(vec.F_[1, siz-2] - vec.F_[1, siz-1]) +
 *                                 dt*vec.S_[1, siz-1])
 */
  __pyx_t_37 = 0;
  __pyx_t_38 = (__pyx_v_siz - 1);

  /* "pylsewave/cynum.pyx":2561
 *         vec.u_star[1, siz-1] = vec.u_n[1, siz-1]
 * 
 *         vec.u_star[0, siz-1] = (vec.u_n[0, siz-1] - theta*(vec.F_[0, siz-2] - vec.F_[0, siz-1]) +             # <<<<<<<<<<<<<<
 *                                 dt*vec.S_[0, siz-1])
 *         vec.u_star[1, siz-1] = (vec.u_n[1, siz-1] - theta*(vec.F_[1, siz-2] - vec.F_[1, siz-1]) +
 */
  __pyx_t_39 = 0;
  __pyx_t_40 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_star.data + __pyx_t_39 * __pyx_v_vec.u_star.strides[0]) )) + __pyx_t_40)) )) = (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_31 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_32)) ))) - (__pyx_v_theta * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_33 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_34)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_35 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_36)) )))))) + (__pyx_v_dt * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_37 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_38)) )))));

  /* "pylsewave/cynum.pyx":2563
 *         vec.u_star[0, siz-1] = (vec.u_n[0, siz-1] - theta*(vec.F_[0, siz-2] - vec.F_[0, siz-1]) +
 *                                 dt*vec.S_[0, siz-1])
 *         vec.u_star[1, siz-1] = (vec.u_n[1, siz-1] - theta*(vec.F_[1, siz-2] - vec.F_[1, siz-1]) +             # <<<<<<<<<<<<<<
 *                                 dt*vec.S_[1, siz-1])
 * 
 */
  __pyx_t_41 = 1;
  __pyx_t_42 = (__pyx_v_siz - 1);
  __pyx_t_43 = 1;
  __pyx_t_44 = (__pyx_v_siz - 2);
  __pyx_t_45 = 1;
  __pyx_t_46 = (__pyx_v_siz - 1);

  /* "pylsewave/cynum.pyx":2564
 *                                 dt*vec.S_[0, siz-1])
 *         vec.u_star[1, siz-1] = (vec.u_n[1, siz-1] - theta*(vec.F_[1, siz-2] - vec.F_[1, siz-1]) +
 *                                 dt*vec.S_[1, siz-1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_47 = 1;
  __pyx_t_48 = (__pyx_v_siz - 1);

  /* "pylsewave/cynum.pyx":2563
 *         vec.u_star[0, siz-1] = (vec.u_n[0, siz-1] - theta*(vec.F_[0, siz-2] - vec.F_[0, siz-1]) +
 *                                 dt*vec.S_[0, siz-1])
 *         vec.u_star[1, siz-1] = (vec.u_n[1, siz-1] - theta*(vec.F_[1, siz-2] - vec.F_[1, siz-1]) +             # <<<<<<<<<<<<<<
 *                                 dt*vec.S_[1, siz-1])
 * 
 */
  __pyx_t_49 = 1;
  __pyx_t_50 = (__pyx_v_siz - 1);
  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_star.data + __pyx_t_49 * __pyx_v_vec.u_star.strides[0]) )) + __pyx_t_50)) )) = (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_41 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_42)) ))) - (__pyx_v_theta * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_43 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_44)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_.data + __pyx_t_45 * __pyx_v_vec.F_.strides[0]) )) + __pyx_t_46)) )))))) + (__pyx_v_dt * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_.data + __pyx_t_47 * __pyx_v_vec.S_.strides[0]) )) + __pyx_t_48)) )))));

  /* "pylsewave/cynum.pyx":2567
 * 
 * 
 *         self._pdes.flux(vec.u_star, 0, vessel_index, vec.F_star)             # <<<<<<<<<<<<<<
 *         self._pdes.source(vec.u_star, 0, vessel_index, vec.S_star)
 * 
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base._pdes->__pyx_vtab)->flux(__pyx_v_self->__pyx_base._pdes, __pyx_v_vec.u_star, 0, __pyx_v_vessel_index, __pyx_v_vec.F_star);

  /* "pylsewave/cynum.pyx":2568
 * 
 *         self._pdes.flux(vec.u_star, 0, vessel_index, vec.F_star)
 *         self._pdes.source(vec.u_star, 0, vessel_index, vec.S_star)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(1, siz-1):
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base._pdes->__pyx_vtab)->source(__pyx_v_self->__pyx_base._pdes, __pyx_v_vec.u_star, 0, __pyx_v_vessel_index, __pyx_v_vec.S_star);

  /* "pylsewave/cynum.pyx":2570
 *         self._pdes.source(vec.u_star, 0, vessel_index, vec.S_star)
 * 
 *         for i in range(1, siz-1):             # <<<<<<<<<<<<<<
 *             vec.u[0, i] = (0.5*(vec.u_n[0, i] + vec.u_star[0, i]) - 0.5*theta*(vec.F_star[0, i] -
 *                            vec.F_star[0, i-1]) + 0.5*dt * vec.S_star[0, i])
 */
  __pyx_t_1 = (__pyx_v_siz - 1);
  for (__pyx_t_2 = 1; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2571
 * 
 *         for i in range(1, siz-1):
 *             vec.u[0, i] = (0.5*(vec.u_n[0, i] + vec.u_star[0, i]) - 0.5*theta*(vec.F_star[0, i] -             # <<<<<<<<<<<<<<
 *                            vec.F_star[0, i-1]) + 0.5*dt * vec.S_star[0, i])
 *             vec.u[1, i] = (0.5*(vec.u_n[1, i] + vec.u_star[1, i]) - 0.5*theta*(vec.F_star[1, i] -
 */
    __pyx_t_51 = 0;
    __pyx_t_52 = __pyx_v_i;
    __pyx_t_53 = 0;
    __pyx_t_54 = __pyx_v_i;
    __pyx_t_55 = 0;
    __pyx_t_56 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2572
 *         for i in range(1, siz-1):
 *             vec.u[0, i] = (0.5*(vec.u_n[0, i] + vec.u_star[0, i]) - 0.5*theta*(vec.F_star[0, i] -
 *                            vec.F_star[0, i-1]) + 0.5*dt * vec.S_star[0, i])             # <<<<<<<<<<<<<<
 *             vec.u[1, i] = (0.5*(vec.u_n[1, i] + vec.u_star[1, i]) - 0.5*theta*(vec.F_star[1, i] -
 *                            vec.F_star[1, i-1]) + 0.5*dt * vec.S_star[1, i])
 */
    __pyx_t_57 = 0;
    __pyx_t_58 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2571
 * 
 *         for i in range(1, siz-1):
 *             vec.u[0, i] = (0.5*(vec.u_n[0, i] + vec.u_star[0, i]) - 0.5*theta*(vec.F_star[0, i] -             # <<<<<<<<<<<<<<
 *                            vec.F_star[0, i-1]) + 0.5*dt * vec.S_star[0, i])
 *             vec.u[1, i] = (0.5*(vec.u_n[1, i] + vec.u_star[1, i]) - 0.5*theta*(vec.F_star[1, i] -
 */
    __pyx_t_59 = 0;
    __pyx_t_60 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2572
 *         for i in range(1, siz-1):
 *             vec.u[0, i] = (0.5*(vec.u_n[0, i] + vec.u_star[0, i]) - 0.5*theta*(vec.F_star[0, i] -
 *                            vec.F_star[0, i-1]) + 0.5*dt * vec.S_star[0, i])             # <<<<<<<<<<<<<<
 *             vec.u[1, i] = (0.5*(vec.u_n[1, i] + vec.u_star[1, i]) - 0.5*theta*(vec.F_star[1, i] -
 *                            vec.F_star[1, i-1]) + 0.5*dt * vec.S_star[1, i])
 */
    __pyx_t_61 = 0;
    __pyx_t_62 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u.data + __pyx_t_61 * __pyx_v_vec.u.strides[0]) )) + __pyx_t_62)) )) = (((0.5 * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_51 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_52)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_star.data + __pyx_t_53 * __pyx_v_vec.u_star.strides[0]) )) + __pyx_t_54)) ))))) - ((0.5 * __pyx_v_theta) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_star.data + __pyx_t_55 * __pyx_v_vec.F_star.strides[0]) )) + __pyx_t_56)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_star.data + __pyx_t_57 * __pyx_v_vec.F_star.strides[0]) )) + __pyx_t_58)) )))))) + ((0.5 * __pyx_v_dt) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_star.data + __pyx_t_59 * __pyx_v_vec.S_star.strides[0]) )) + __pyx_t_60)) )))));

    /* "pylsewave/cynum.pyx":2573
 *             vec.u[0, i] = (0.5*(vec.u_n[0, i] + vec.u_star[0, i]) - 0.5*theta*(vec.F_star[0, i] -
 *                            vec.F_star[0, i-1]) + 0.5*dt * vec.S_star[0, i])
 *             vec.u[1, i] = (0.5*(vec.u_n[1, i] + vec.u_star[1, i]) - 0.5*theta*(vec.F_star[1, i] -             # <<<<<<<<<<<<<<
 *                            vec.F_star[1, i-1]) + 0.5*dt * vec.S_star[1, i])
 * 
 */
    __pyx_t_63 = 1;
    __pyx_t_64 = __pyx_v_i;
    __pyx_t_65 = 1;
    __pyx_t_66 = __pyx_v_i;
    __pyx_t_67 = 1;
    __pyx_t_68 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2574
 *                            vec.F_star[0, i-1]) + 0.5*dt * vec.S_star[0, i])
 *             vec.u[1, i] = (0.5*(vec.u_n[1, i] + vec.u_star[1, i]) - 0.5*theta*(vec.F_star[1, i] -
 *                            vec.F_star[1, i-1]) + 0.5*dt * vec.S_star[1, i])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_69 = 1;
    __pyx_t_70 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2573
 *             vec.u[0, i] = (0.5*(vec.u_n[0, i] + vec.u_star[0, i]) - 0.5*theta*(vec.F_star[0, i] -
 *                            vec.F_star[0, i-1]) + 0.5*dt * vec.S_star[0, i])
 *             vec.u[1, i] = (0.5*(vec.u_n[1, i] + vec.u_star[1, i]) - 0.5*theta*(vec.F_star[1, i] -             # <<<<<<<<<<<<<<
 *                            vec.F_star[1, i-1]) + 0.5*dt * vec.S_star[1, i])
 * 
 */
    __pyx_t_71 = 1;
    __pyx_t_72 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2574
 *                            vec.F_star[0, i-1]) + 0.5*dt * vec.S_star[0, i])
 *             vec.u[1, i] = (0.5*(vec.u_n[1, i] + vec.u_star[1, i]) - 0.5*theta*(vec.F_star[1, i] -
 *                            vec.F_star[1, i-1]) + 0.5*dt * vec.S_star[1, i])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_73 = 1;
    __pyx_t_74 = __pyx_v_i;
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u.data + __pyx_t_73 * __pyx_v_vec.u.strides[0]) )) + __pyx_t_74)) )) = (((0.5 * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_n.data + __pyx_t_63 * __pyx_v_vec.u_n.strides[0]) )) + __pyx_t_64)) ))) + (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.u_star.data + __pyx_t_65 * __pyx_v_vec.u_star.strides[0]) )) + __pyx_t_66)) ))))) - ((0.5 * __pyx_v_theta) * ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_star.data + __pyx_t_67 * __pyx_v_vec.F_star.strides[0]) )) + __pyx_t_68)) ))) - (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.F_star.data + __pyx_t_69 * __pyx_v_vec.F_star.strides[0]) )) + __pyx_t_70)) )))))) + ((0.5 * __pyx_v_dt) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vec.S_star.data + __pyx_t_71 * __pyx_v_vec.S_star.strides[0]) )) + __pyx_t_72)) )))));
  }

  /* "pylsewave/cynum.pyx":2533
 *     @cython.wraparound(False)
 *     @cython.cdivision(True)
 *     cdef void advance(self, U vec, double dt, double dx, int vessel_index) nogil:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t siz
 *         cdef Py_ssize_t i, j
 */

  /* function exit code */
}

/* "pylsewave/cynum.pyx":2585
 *     @cython.initializedcheck(False)
 *     @cython.cdivision(True)
 *     cpdef int _advance_Godunov_splitting(self, cParabolicSolObj parStruct, double[:, ::1] u, int n, double dt,             # <<<<<<<<<<<<<<
 *                                           double dx, int vessel_index, double theta):
 *         cdef Py_ssize_t N_n = u.shape[1]
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_1_advance_Godunov_splitting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver__advance_Godunov_splitting(struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *__pyx_v_self, struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj __pyx_v_parStruct, __Pyx_memviewslice __pyx_v_u, CYTHON_UNUSED int __pyx_v_n, CYTHON_UNUSED double __pyx_v_dt, CYTHON_UNUSED double __pyx_v_dx, int __pyx_v_vessel_index, double __pyx_v_theta, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_N_n;
  Py_ssize_t __pyx_v_i;
  double __pyx_v_F;
  double __pyx_v_gamma;
  __Pyx_memviewslice __pyx_v_C_v = { 0, 0, { 0 }, { 0 }, { 0 } };
  CYTHON_UNUSED int __pyx_v_res;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  Py_ssize_t __pyx_t_64;
  Py_ssize_t __pyx_t_65;
  Py_ssize_t __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  Py_ssize_t __pyx_t_70;
  Py_ssize_t __pyx_t_71;
  Py_ssize_t __pyx_t_72;
  __Pyx_memviewslice __pyx_t_73 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_74;
  __Pyx_RefNannySetupContext("_advance_Godunov_splitting", 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_advance_Godunov_splitting); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_1_advance_Godunov_splitting)) {
      __pyx_t_3 = __pyx_convert__to_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj(__pyx_v_parStruct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyFloat_FromDouble(__pyx_v_theta); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __pyx_t_1; __pyx_t_11 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_12 = 1;
        }
      }
      __pyx_t_13 = PyTuple_New(7+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (__pyx_t_11) {
        __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_12, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_12, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_13, 4+__pyx_t_12, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_13, 5+__pyx_t_12, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_13, 6+__pyx_t_12, __pyx_t_9);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_9 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2585, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_14;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":2587
 *     cpdef int _advance_Godunov_splitting(self, cParabolicSolObj parStruct, double[:, ::1] u, int n, double dt,
 *                                           double dx, int vessel_index, double theta):
 *         cdef Py_ssize_t N_n = u.shape[1]             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef double F, gamma
 */
  __pyx_v_N_n = (__pyx_v_u.shape[1]);

  /* "pylsewave/cynum.pyx":2590
 *         cdef Py_ssize_t i
 *         cdef double F, gamma
 *         cdef double[::1] C_v = np.zeros(N_n, dtype=np.float)             # <<<<<<<<<<<<<<
 * 
 *         self._pdes.CV_f(u[0, :], vessel_index, C_v)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_N_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_float); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_9);
  if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_v_C_v = __pyx_t_15;
  __pyx_t_15.memview = NULL;
  __pyx_t_15.data = NULL;

  /* "pylsewave/cynum.pyx":2592
 *         cdef double[::1] C_v = np.zeros(N_n, dtype=np.float)
 * 
 *         self._pdes.CV_f(u[0, :], vessel_index, C_v)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(N_n-2):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._pdes), __pyx_n_s_CV_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15.data = __pyx_v_u.data;
  __pyx_t_15.memview = __pyx_v_u.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_15, 0);
  {
    Py_ssize_t __pyx_tmp_idx = 0;
    Py_ssize_t __pyx_tmp_shape = __pyx_v_u.shape[0];
    Py_ssize_t __pyx_tmp_stride = __pyx_v_u.strides[0];
    if (0 && (__pyx_tmp_idx < 0))
        __pyx_tmp_idx += __pyx_tmp_shape;
    if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
        PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
        __PYX_ERR(0, 2592, __pyx_L1_error)
    }
        __pyx_t_15.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_15.shape[0] = __pyx_v_u.shape[1];
__pyx_t_15.strides[0] = __pyx_v_u.strides[1];
    __pyx_t_15.suboffsets[0] = -1;

__pyx_t_10 = __pyx_memoryview_fromslice(__pyx_t_15, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_vessel_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_13 = __pyx_memoryview_fromslice(__pyx_v_C_v, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_8 = NULL;
  __pyx_t_12 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_12 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_8) {
    __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_12, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_12, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_13);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_12, __pyx_t_13);
  __pyx_t_10 = 0;
  __pyx_t_2 = 0;
  __pyx_t_13 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "pylsewave/cynum.pyx":2594
 *         self._pdes.CV_f(u[0, :], vessel_index, C_v)
 * 
 *         for i in range(N_n-2):             # <<<<<<<<<<<<<<
 *             parStruct.a_ph[i] = 0.5 * (C_v[i+1] + C_v[i+2])
 *         # print(a_ph)
 */
  __pyx_t_12 = (__pyx_v_N_n - 2);
  for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_12; __pyx_t_16+=1) {
    __pyx_v_i = __pyx_t_16;

    /* "pylsewave/cynum.pyx":2595
 * 
 *         for i in range(N_n-2):
 *             parStruct.a_ph[i] = 0.5 * (C_v[i+1] + C_v[i+2])             # <<<<<<<<<<<<<<
 *         # print(a_ph)
 *             parStruct.a_mh[i] = 0.5 * (C_v[i+1] + C_v[i])
 */
    __pyx_t_17 = (__pyx_v_i + 1);
    __pyx_t_18 = (__pyx_v_i + 2);
    __pyx_t_19 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_ph.data) + __pyx_t_19)) )) = (0.5 * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_C_v.data) + __pyx_t_17)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_C_v.data) + __pyx_t_18)) )))));

    /* "pylsewave/cynum.pyx":2597
 *             parStruct.a_ph[i] = 0.5 * (C_v[i+1] + C_v[i+2])
 *         # print(a_ph)
 *             parStruct.a_mh[i] = 0.5 * (C_v[i+1] + C_v[i])             # <<<<<<<<<<<<<<
 *             parStruct.b[i] = (1 + (u[0, i+1]/self._pdes._rho)*theta * F *
 *                               (parStruct.a_ph[i] + parStruct.a_mh[i]))
 */
    __pyx_t_20 = (__pyx_v_i + 1);
    __pyx_t_21 = __pyx_v_i;
    __pyx_t_22 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_mh.data) + __pyx_t_22)) )) = (0.5 * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_C_v.data) + __pyx_t_20)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_C_v.data) + __pyx_t_21)) )))));

    /* "pylsewave/cynum.pyx":2598
 *         # print(a_ph)
 *             parStruct.a_mh[i] = 0.5 * (C_v[i+1] + C_v[i])
 *             parStruct.b[i] = (1 + (u[0, i+1]/self._pdes._rho)*theta * F *             # <<<<<<<<<<<<<<
 *                               (parStruct.a_ph[i] + parStruct.a_mh[i]))
 * 
 */
    __pyx_t_23 = 0;
    __pyx_t_24 = (__pyx_v_i + 1);

    /* "pylsewave/cynum.pyx":2599
 *             parStruct.a_mh[i] = 0.5 * (C_v[i+1] + C_v[i])
 *             parStruct.b[i] = (1 + (u[0, i+1]/self._pdes._rho)*theta * F *
 *                               (parStruct.a_ph[i] + parStruct.a_mh[i]))             # <<<<<<<<<<<<<<
 * 
 *         for i in range(N_n-3):
 */
    __pyx_t_25 = __pyx_v_i;
    __pyx_t_26 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2598
 *         # print(a_ph)
 *             parStruct.a_mh[i] = 0.5 * (C_v[i+1] + C_v[i])
 *             parStruct.b[i] = (1 + (u[0, i+1]/self._pdes._rho)*theta * F *             # <<<<<<<<<<<<<<
 *                               (parStruct.a_ph[i] + parStruct.a_mh[i]))
 * 
 */
    __pyx_t_27 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.b.data) + __pyx_t_27)) )) = (1.0 + (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_23 * __pyx_v_u.strides[0]) )) + __pyx_t_24)) ))) / __pyx_v_self->__pyx_base.__pyx_base._pdes->_rho) * __pyx_v_theta) * __pyx_v_F) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_ph.data) + __pyx_t_25)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_mh.data) + __pyx_t_26)) ))))));
  }

  /* "pylsewave/cynum.pyx":2601
 *                               (parStruct.a_ph[i] + parStruct.a_mh[i]))
 * 
 *         for i in range(N_n-3):             # <<<<<<<<<<<<<<
 *             parStruct.a[i] = -(u[0, i+2]/self._pdes._rho)*theta * F * parStruct.a_mh[i+1]
 *             parStruct.c[i] = -(u[0, i+1]/self._pdes._rho)*theta * F * parStruct.a_ph[i]
 */
  __pyx_t_12 = (__pyx_v_N_n - 3);
  for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_12; __pyx_t_16+=1) {
    __pyx_v_i = __pyx_t_16;

    /* "pylsewave/cynum.pyx":2602
 * 
 *         for i in range(N_n-3):
 *             parStruct.a[i] = -(u[0, i+2]/self._pdes._rho)*theta * F * parStruct.a_mh[i+1]             # <<<<<<<<<<<<<<
 *             parStruct.c[i] = -(u[0, i+1]/self._pdes._rho)*theta * F * parStruct.a_ph[i]
 * 
 */
    __pyx_t_28 = 0;
    __pyx_t_29 = (__pyx_v_i + 2);
    __pyx_t_30 = (__pyx_v_i + 1);
    __pyx_t_31 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a.data) + __pyx_t_31)) )) = ((((-((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_28 * __pyx_v_u.strides[0]) )) + __pyx_t_29)) ))) / __pyx_v_self->__pyx_base.__pyx_base._pdes->_rho)) * __pyx_v_theta) * __pyx_v_F) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_mh.data) + __pyx_t_30)) ))));

    /* "pylsewave/cynum.pyx":2603
 *         for i in range(N_n-3):
 *             parStruct.a[i] = -(u[0, i+2]/self._pdes._rho)*theta * F * parStruct.a_mh[i+1]
 *             parStruct.c[i] = -(u[0, i+1]/self._pdes._rho)*theta * F * parStruct.a_ph[i]             # <<<<<<<<<<<<<<
 * 
 *         # # ---- BCd Neuman ----- ##
 */
    __pyx_t_32 = 0;
    __pyx_t_33 = (__pyx_v_i + 1);
    __pyx_t_34 = __pyx_v_i;
    __pyx_t_35 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.c.data) + __pyx_t_35)) )) = ((((-((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_32 * __pyx_v_u.strides[0]) )) + __pyx_t_33)) ))) / __pyx_v_self->__pyx_base.__pyx_base._pdes->_rho)) * __pyx_v_theta) * __pyx_v_F) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_ph.data) + __pyx_t_34)) ))));
  }

  /* "pylsewave/cynum.pyx":2606
 * 
 *         # # ---- BCd Neuman ----- ##
 *         parStruct.b[0] = (1 + (u[0, 1]/self._pdes._rho)*theta * F *             # <<<<<<<<<<<<<<
 *                           (parStruct.a_ph[0] + parStruct.a_mh[0])) -\
 *                          (u[0, 1]/self._pdes._rho)*theta * F * parStruct.a_mh[0]
 */
  __pyx_t_36 = 0;
  __pyx_t_37 = 1;

  /* "pylsewave/cynum.pyx":2607
 *         # # ---- BCd Neuman ----- ##
 *         parStruct.b[0] = (1 + (u[0, 1]/self._pdes._rho)*theta * F *
 *                           (parStruct.a_ph[0] + parStruct.a_mh[0])) -\             # <<<<<<<<<<<<<<
 *                          (u[0, 1]/self._pdes._rho)*theta * F * parStruct.a_mh[0]
 *         # here the value for m, m-1
 */
  __pyx_t_38 = 0;
  __pyx_t_39 = 0;

  /* "pylsewave/cynum.pyx":2608
 *         parStruct.b[0] = (1 + (u[0, 1]/self._pdes._rho)*theta * F *
 *                           (parStruct.a_ph[0] + parStruct.a_mh[0])) -\
 *                          (u[0, 1]/self._pdes._rho)*theta * F * parStruct.a_mh[0]             # <<<<<<<<<<<<<<
 *         # here the value for m, m-1
 *         parStruct.b[N_n-3] = (1 + (u[0, N_n-2]/self._pdes._rho)*theta * F *
 */
  __pyx_t_40 = 0;
  __pyx_t_41 = 1;
  __pyx_t_42 = 0;

  /* "pylsewave/cynum.pyx":2606
 * 
 *         # # ---- BCd Neuman ----- ##
 *         parStruct.b[0] = (1 + (u[0, 1]/self._pdes._rho)*theta * F *             # <<<<<<<<<<<<<<
 *                           (parStruct.a_ph[0] + parStruct.a_mh[0])) -\
 *                          (u[0, 1]/self._pdes._rho)*theta * F * parStruct.a_mh[0]
 */
  __pyx_t_43 = 0;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.b.data) + __pyx_t_43)) )) = ((1.0 + (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_36 * __pyx_v_u.strides[0]) )) + __pyx_t_37)) ))) / __pyx_v_self->__pyx_base.__pyx_base._pdes->_rho) * __pyx_v_theta) * __pyx_v_F) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_ph.data) + __pyx_t_38)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_mh.data) + __pyx_t_39)) )))))) - (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_40 * __pyx_v_u.strides[0]) )) + __pyx_t_41)) ))) / __pyx_v_self->__pyx_base.__pyx_base._pdes->_rho) * __pyx_v_theta) * __pyx_v_F) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_mh.data) + __pyx_t_42)) )))));

  /* "pylsewave/cynum.pyx":2610
 *                          (u[0, 1]/self._pdes._rho)*theta * F * parStruct.a_mh[0]
 *         # here the value for m, m-1
 *         parStruct.b[N_n-3] = (1 + (u[0, N_n-2]/self._pdes._rho)*theta * F *             # <<<<<<<<<<<<<<
 *                               (parStruct.a_ph[N_n-3] + parStruct.a_mh[N_n-3])) -\
 *                              (u[0, N_n-2]/self._pdes._rho)*theta * F * parStruct.a_ph[N_n-3]
 */
  __pyx_t_44 = 0;
  __pyx_t_45 = (__pyx_v_N_n - 2);

  /* "pylsewave/cynum.pyx":2611
 *         # here the value for m, m-1
 *         parStruct.b[N_n-3] = (1 + (u[0, N_n-2]/self._pdes._rho)*theta * F *
 *                               (parStruct.a_ph[N_n-3] + parStruct.a_mh[N_n-3])) -\             # <<<<<<<<<<<<<<
 *                              (u[0, N_n-2]/self._pdes._rho)*theta * F * parStruct.a_ph[N_n-3]
 * 
 */
  __pyx_t_46 = (__pyx_v_N_n - 3);
  __pyx_t_47 = (__pyx_v_N_n - 3);

  /* "pylsewave/cynum.pyx":2612
 *         parStruct.b[N_n-3] = (1 + (u[0, N_n-2]/self._pdes._rho)*theta * F *
 *                               (parStruct.a_ph[N_n-3] + parStruct.a_mh[N_n-3])) -\
 *                              (u[0, N_n-2]/self._pdes._rho)*theta * F * parStruct.a_ph[N_n-3]             # <<<<<<<<<<<<<<
 * 
 *         gamma = (1 - theta)
 */
  __pyx_t_48 = 0;
  __pyx_t_49 = (__pyx_v_N_n - 2);
  __pyx_t_50 = (__pyx_v_N_n - 3);

  /* "pylsewave/cynum.pyx":2610
 *                          (u[0, 1]/self._pdes._rho)*theta * F * parStruct.a_mh[0]
 *         # here the value for m, m-1
 *         parStruct.b[N_n-3] = (1 + (u[0, N_n-2]/self._pdes._rho)*theta * F *             # <<<<<<<<<<<<<<
 *                               (parStruct.a_ph[N_n-3] + parStruct.a_mh[N_n-3])) -\
 *                              (u[0, N_n-2]/self._pdes._rho)*theta * F * parStruct.a_ph[N_n-3]
 */
  __pyx_t_51 = (__pyx_v_N_n - 3);
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.b.data) + __pyx_t_51)) )) = ((1.0 + (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_44 * __pyx_v_u.strides[0]) )) + __pyx_t_45)) ))) / __pyx_v_self->__pyx_base.__pyx_base._pdes->_rho) * __pyx_v_theta) * __pyx_v_F) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_ph.data) + __pyx_t_46)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_mh.data) + __pyx_t_47)) )))))) - (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_48 * __pyx_v_u.strides[0]) )) + __pyx_t_49)) ))) / __pyx_v_self->__pyx_base.__pyx_base._pdes->_rho) * __pyx_v_theta) * __pyx_v_F) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_ph.data) + __pyx_t_50)) )))));

  /* "pylsewave/cynum.pyx":2614
 *                              (u[0, N_n-2]/self._pdes._rho)*theta * F * parStruct.a_ph[N_n-3]
 * 
 *         gamma = (1 - theta)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(1, N_n-1):
 */
  __pyx_v_gamma = (1.0 - __pyx_v_theta);

  /* "pylsewave/cynum.pyx":2616
 *         gamma = (1 - theta)
 * 
 *         for i in range(1, N_n-1):             # <<<<<<<<<<<<<<
 *             # print(i)
 *             parStruct.d[i] = ((u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_mh[i-1] * u[1, i-1] +
 */
  __pyx_t_12 = (__pyx_v_N_n - 1);
  for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_12; __pyx_t_16+=1) {
    __pyx_v_i = __pyx_t_16;

    /* "pylsewave/cynum.pyx":2618
 *         for i in range(1, N_n-1):
 *             # print(i)
 *             parStruct.d[i] = ((u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_mh[i-1] * u[1, i-1] +             # <<<<<<<<<<<<<<
 *                               (1 - (u[0,i]/self._pdes._rho)*gamma * F * (parStruct.a_mh[i-1] +
 *                               parStruct.a_ph[i-1])) * u[1, i] +
 */
    __pyx_t_52 = 0;
    __pyx_t_53 = __pyx_v_i;
    __pyx_t_54 = (__pyx_v_i - 1);
    __pyx_t_55 = 1;
    __pyx_t_56 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2619
 *             # print(i)
 *             parStruct.d[i] = ((u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_mh[i-1] * u[1, i-1] +
 *                               (1 - (u[0,i]/self._pdes._rho)*gamma * F * (parStruct.a_mh[i-1] +             # <<<<<<<<<<<<<<
 *                               parStruct.a_ph[i-1])) * u[1, i] +
 *                               (u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_ph[i-1] * u[1, i+1])
 */
    __pyx_t_57 = 0;
    __pyx_t_58 = __pyx_v_i;
    __pyx_t_59 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2620
 *             parStruct.d[i] = ((u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_mh[i-1] * u[1, i-1] +
 *                               (1 - (u[0,i]/self._pdes._rho)*gamma * F * (parStruct.a_mh[i-1] +
 *                               parStruct.a_ph[i-1])) * u[1, i] +             # <<<<<<<<<<<<<<
 *                               (u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_ph[i-1] * u[1, i+1])
 * 
 */
    __pyx_t_60 = (__pyx_v_i - 1);

    /* "pylsewave/cynum.pyx":2619
 *             # print(i)
 *             parStruct.d[i] = ((u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_mh[i-1] * u[1, i-1] +
 *                               (1 - (u[0,i]/self._pdes._rho)*gamma * F * (parStruct.a_mh[i-1] +             # <<<<<<<<<<<<<<
 *                               parStruct.a_ph[i-1])) * u[1, i] +
 *                               (u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_ph[i-1] * u[1, i+1])
 */
    __pyx_t_61 = 1;
    __pyx_t_62 = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2621
 *                               (1 - (u[0,i]/self._pdes._rho)*gamma * F * (parStruct.a_mh[i-1] +
 *                               parStruct.a_ph[i-1])) * u[1, i] +
 *                               (u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_ph[i-1] * u[1, i+1])             # <<<<<<<<<<<<<<
 * 
 *         res = tdma(&parStruct.a[0], &parStruct.b[0], &parStruct.c[0],
 */
    __pyx_t_63 = 0;
    __pyx_t_64 = __pyx_v_i;
    __pyx_t_65 = (__pyx_v_i - 1);
    __pyx_t_66 = 1;
    __pyx_t_67 = (__pyx_v_i + 1);

    /* "pylsewave/cynum.pyx":2618
 *         for i in range(1, N_n-1):
 *             # print(i)
 *             parStruct.d[i] = ((u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_mh[i-1] * u[1, i-1] +             # <<<<<<<<<<<<<<
 *                               (1 - (u[0,i]/self._pdes._rho)*gamma * F * (parStruct.a_mh[i-1] +
 *                               parStruct.a_ph[i-1])) * u[1, i] +
 */
    __pyx_t_68 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.d.data) + __pyx_t_68)) )) = ((((((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_52 * __pyx_v_u.strides[0]) )) + __pyx_t_53)) ))) / __pyx_v_self->__pyx_base.__pyx_base._pdes->_rho) * __pyx_v_gamma) * __pyx_v_F) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_mh.data) + __pyx_t_54)) )))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_55 * __pyx_v_u.strides[0]) )) + __pyx_t_56)) )))) + ((1.0 - (((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_57 * __pyx_v_u.strides[0]) )) + __pyx_t_58)) ))) / __pyx_v_self->__pyx_base.__pyx_base._pdes->_rho) * __pyx_v_gamma) * __pyx_v_F) * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_mh.data) + __pyx_t_59)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_ph.data) + __pyx_t_60)) )))))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_61 * __pyx_v_u.strides[0]) )) + __pyx_t_62)) ))))) + ((((((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_63 * __pyx_v_u.strides[0]) )) + __pyx_t_64)) ))) / __pyx_v_self->__pyx_base.__pyx_base._pdes->_rho) * __pyx_v_gamma) * __pyx_v_F) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a_ph.data) + __pyx_t_65)) )))) * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_u.data + __pyx_t_66 * __pyx_v_u.strides[0]) )) + __pyx_t_67)) )))));
  }

  /* "pylsewave/cynum.pyx":2623
 *                               (u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_ph[i-1] * u[1, i+1])
 * 
 *         res = tdma(&parStruct.a[0], &parStruct.b[0], &parStruct.c[0],             # <<<<<<<<<<<<<<
 *                    &parStruct.d[1:N_n-1][0], &u[1, 1:N_n-1][0], N_n-2)
 * 
 */
  __pyx_t_69 = 0;
  __pyx_t_70 = 0;
  __pyx_t_71 = 0;

  /* "pylsewave/cynum.pyx":2624
 * 
 *         res = tdma(&parStruct.a[0], &parStruct.b[0], &parStruct.c[0],
 *                    &parStruct.d[1:N_n-1][0], &u[1, 1:N_n-1][0], N_n-2)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_15.data = __pyx_v_parStruct.d.data;
  __pyx_t_15.memview = __pyx_v_parStruct.d.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_15, 0);
  __pyx_t_14 = -1;
  if (unlikely(__pyx_memoryview_slice_memviewslice(
    &__pyx_t_15,
    __pyx_v_parStruct.d.shape[0], __pyx_v_parStruct.d.strides[0], __pyx_v_parStruct.d.suboffsets[0],
    0,
    0,
    &__pyx_t_14,
    1,
    (__pyx_v_N_n - 1),
    0,
    1,
    1,
    0,
    1) < 0))
{
    __PYX_ERR(0, 2624, __pyx_L1_error)
}

__pyx_t_72 = 0;
  __pyx_t_73.data = __pyx_v_u.data;
  __pyx_t_73.memview = __pyx_v_u.memview;
  __PYX_INC_MEMVIEW(&__pyx_t_73, 0);
  {
    Py_ssize_t __pyx_tmp_idx = 1;
    Py_ssize_t __pyx_tmp_shape = __pyx_v_u.shape[0];
    Py_ssize_t __pyx_tmp_stride = __pyx_v_u.strides[0];
    if (0 && (__pyx_tmp_idx < 0))
        __pyx_tmp_idx += __pyx_tmp_shape;
    if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
        PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
        __PYX_ERR(0, 2624, __pyx_L1_error)
    }
        __pyx_t_73.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_14 = -1;
  if (unlikely(__pyx_memoryview_slice_memviewslice(
    &__pyx_t_73,
    __pyx_v_u.shape[1], __pyx_v_u.strides[1], __pyx_v_u.suboffsets[1],
    1,
    0,
    &__pyx_t_14,
    1,
    (__pyx_v_N_n - 1),
    0,
    1,
    1,
    0,
    1) < 0))
{
    __PYX_ERR(0, 2624, __pyx_L1_error)
}

__pyx_t_74 = 0;

  /* "pylsewave/cynum.pyx":2623
 *                               (u[0,i]/self._pdes._rho)*gamma * F * parStruct.a_ph[i-1] * u[1, i+1])
 * 
 *         res = tdma(&parStruct.a[0], &parStruct.b[0], &parStruct.c[0],             # <<<<<<<<<<<<<<
 *                    &parStruct.d[1:N_n-1][0], &u[1, 1:N_n-1][0], N_n-2)
 * 
 */
  __pyx_v_res = funs::tdma((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.a.data) + __pyx_t_69)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.b.data) + __pyx_t_70)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_parStruct.c.data) + __pyx_t_71)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_15.data) + __pyx_t_72)) )))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_t_73.data) + __pyx_t_74)) )))), (__pyx_v_N_n - 2));
  __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_73, 1);

  /* "pylsewave/cynum.pyx":2585
 *     @cython.initializedcheck(False)
 *     @cython.cdivision(True)
 *     cpdef int _advance_Godunov_splitting(self, cParabolicSolObj parStruct, double[:, ::1] u, int n, double dt,             # <<<<<<<<<<<<<<
 *                                           double dx, int vessel_index, double theta):
 *         cdef Py_ssize_t N_n = u.shape[1]
 */

  /* 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_73, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cMacCormackGodunovSplitSolver._advance_Godunov_splitting", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_C_v, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_1_advance_Godunov_splitting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_1_advance_Godunov_splitting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj __pyx_v_parStruct;
  __Pyx_memviewslice __pyx_v_u = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_n;
  double __pyx_v_dt;
  double __pyx_v_dx;
  int __pyx_v_vessel_index;
  double __pyx_v_theta;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_advance_Godunov_splitting (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parStruct,&__pyx_n_s_u,&__pyx_n_s_n,&__pyx_n_s_dt,&__pyx_n_s_dx,&__pyx_n_s_vessel_index,&__pyx_n_s_theta,0};
    PyObject* values[7] = {0,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  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parStruct)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_advance_Godunov_splitting", 1, 7, 7, 1); __PYX_ERR(0, 2585, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_advance_Godunov_splitting", 1, 7, 7, 2); __PYX_ERR(0, 2585, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_advance_Godunov_splitting", 1, 7, 7, 3); __PYX_ERR(0, 2585, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_advance_Godunov_splitting", 1, 7, 7, 4); __PYX_ERR(0, 2585, __pyx_L3_error)
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vessel_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_advance_Godunov_splitting", 1, 7, 7, 5); __PYX_ERR(0, 2585, __pyx_L3_error)
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_advance_Godunov_splitting", 1, 7, 7, 6); __PYX_ERR(0, 2585, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_advance_Godunov_splitting") < 0)) __PYX_ERR(0, 2585, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      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);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_parStruct = __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2585, __pyx_L3_error)
    __pyx_v_u = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[1]); if (unlikely(!__pyx_v_u.memview)) __PYX_ERR(0, 2585, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2585, __pyx_L3_error)
    __pyx_v_dt = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_dt == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2585, __pyx_L3_error)
    __pyx_v_dx = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2586, __pyx_L3_error)
    __pyx_v_vessel_index = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_vessel_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2586, __pyx_L3_error)
    __pyx_v_theta = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_theta == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2586, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_advance_Godunov_splitting", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2585, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cMacCormackGodunovSplitSolver._advance_Godunov_splitting", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver__advance_Godunov_splitting(((struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *)__pyx_v_self), __pyx_v_parStruct, __pyx_v_u, __pyx_v_n, __pyx_v_dt, __pyx_v_dx, __pyx_v_vessel_index, __pyx_v_theta);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver__advance_Godunov_splitting(struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *__pyx_v_self, struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj __pyx_v_parStruct, __Pyx_memviewslice __pyx_v_u, int __pyx_v_n, double __pyx_v_dt, double __pyx_v_dx, int __pyx_v_vessel_index, double __pyx_v_theta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_advance_Godunov_splitting", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver__advance_Godunov_splitting(__pyx_v_self, __pyx_v_parStruct, __pyx_v_u, __pyx_v_n, __pyx_v_dt, __pyx_v_dx, __pyx_v_vessel_index, __pyx_v_theta, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2585, __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("pylsewave.cynum.cMacCormackGodunovSplitSolver._advance_Godunov_splitting", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_u, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2632
 *     @cython.initializedcheck(False)
 *     @cython.cdivision(True)
 *     cpdef SOLVER solve(self, user_action=None,             # <<<<<<<<<<<<<<
 *               version="vectorised"):
 * 
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_3solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static enum __pyx_t_9pylsewave_5cynum_SOLVER __pyx_f_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_solve(struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_solve *__pyx_optional_args) {
  PyObject *__pyx_v_user_action = ((PyObject *)Py_None);
  PyObject *__pyx_v_version = ((PyObject *)__pyx_n_s_vectorised);
  Py_ssize_t __pyx_v_length;
  Py_ssize_t __pyx_v_len_x;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  __Pyx_memviewslice __pyx_v_getarr = { 0, 0, { 0 }, { 0 }, { 0 } };
  enum __pyx_t_9pylsewave_5cynum_CFL __pyx_v_res_cfl;
  std::vector<struct __pyx_t_9pylsewave_5cynum_U>  __pyx_v_v_U;
  PyObject *__pyx_v_time = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_t0 = NULL;
  std::vector<struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj>  __pyx_v_parU;
  PyObject *__pyx_v_N_n = NULL;
  double __pyx_v_p;
  int __pyx_v_index;
  int __pyx_v_siz_U0;
  int __pyx_v_k;
  CYTHON_UNUSED int __pyx_v_siz_UL;
  int __pyx_v_siz_UBif;
  int __pyx_v_siz_UConj;
  int __pyx_v_par;
  int __pyx_v_d1;
  int __pyx_v_d2;
  __Pyx_memviewslice __pyx_v_u_nmp1 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_x_n = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_u_nmp1_conj = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_x_n_conj = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_last_index;
  int __pyx_v_first_index;
  CYTHON_UNUSED int __pyx_v_iter_count;
  __Pyx_memviewslice __pyx_v_bif_list = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_conj_list = { 0, 0, { 0 }, { 0 }, { 0 } };
  enum __pyx_t_9pylsewave_5cynum_SOLVER __pyx_r;
  __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;
  enum __pyx_t_9pylsewave_5cynum_SOLVER __pyx_t_7;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  double __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_t_23;
  int __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  __Pyx_memviewslice __pyx_t_28 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  PyObject *__pyx_t_37 = NULL;
  PyObject *__pyx_t_38 = NULL;
  PyObject *__pyx_t_39 = NULL;
  PyObject *__pyx_t_40 = NULL;
  PyObject *__pyx_t_41 = NULL;
  long __pyx_t_42;
  int __pyx_t_43;
  int __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  int __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  Py_ssize_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  Py_ssize_t __pyx_t_60;
  Py_ssize_t __pyx_t_61;
  double __pyx_t_62;
  double __pyx_t_63;
  double __pyx_t_64;
  double __pyx_t_65;
  double __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  Py_ssize_t __pyx_t_70;
  Py_ssize_t __pyx_t_71;
  Py_ssize_t __pyx_t_72;
  Py_ssize_t __pyx_t_73;
  Py_ssize_t __pyx_t_74;
  Py_ssize_t __pyx_t_75;
  Py_ssize_t __pyx_t_76;
  Py_ssize_t __pyx_t_77;
  Py_ssize_t __pyx_t_78;
  Py_ssize_t __pyx_t_79;
  Py_ssize_t __pyx_t_80;
  Py_ssize_t __pyx_t_81;
  Py_ssize_t __pyx_t_82;
  Py_ssize_t __pyx_t_83;
  Py_ssize_t __pyx_t_84;
  Py_ssize_t __pyx_t_85;
  Py_ssize_t __pyx_t_86;
  Py_ssize_t __pyx_t_87;
  Py_ssize_t __pyx_t_88;
  Py_ssize_t __pyx_t_89;
  Py_ssize_t __pyx_t_90;
  Py_ssize_t __pyx_t_91;
  Py_ssize_t __pyx_t_92;
  Py_ssize_t __pyx_t_93;
  Py_ssize_t __pyx_t_94;
  Py_ssize_t __pyx_t_95;
  Py_ssize_t __pyx_t_96;
  Py_ssize_t __pyx_t_97;
  Py_ssize_t __pyx_t_98;
  Py_ssize_t __pyx_t_99;
  Py_ssize_t __pyx_t_100;
  Py_ssize_t __pyx_t_101;
  Py_ssize_t __pyx_t_102;
  Py_ssize_t __pyx_t_103;
  Py_ssize_t __pyx_t_104;
  Py_ssize_t __pyx_t_105;
  Py_ssize_t __pyx_t_106;
  Py_ssize_t __pyx_t_107;
  Py_ssize_t __pyx_t_108;
  Py_ssize_t __pyx_t_109;
  Py_ssize_t __pyx_t_110;
  Py_ssize_t __pyx_t_111;
  Py_ssize_t __pyx_t_112;
  Py_ssize_t __pyx_t_113;
  Py_ssize_t __pyx_t_114;
  struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_bif __pyx_t_115;
  Py_ssize_t __pyx_t_116;
  Py_ssize_t __pyx_t_117;
  Py_ssize_t __pyx_t_118;
  Py_ssize_t __pyx_t_119;
  Py_ssize_t __pyx_t_120;
  Py_ssize_t __pyx_t_121;
  Py_ssize_t __pyx_t_122;
  Py_ssize_t __pyx_t_123;
  Py_ssize_t __pyx_t_124;
  Py_ssize_t __pyx_t_125;
  Py_ssize_t __pyx_t_126;
  Py_ssize_t __pyx_t_127;
  Py_ssize_t __pyx_t_128;
  Py_ssize_t __pyx_t_129;
  Py_ssize_t __pyx_t_130;
  Py_ssize_t __pyx_t_131;
  Py_ssize_t __pyx_t_132;
  Py_ssize_t __pyx_t_133;
  Py_ssize_t __pyx_t_134;
  Py_ssize_t __pyx_t_135;
  Py_ssize_t __pyx_t_136;
  Py_ssize_t __pyx_t_137;
  Py_ssize_t __pyx_t_138;
  Py_ssize_t __pyx_t_139;
  Py_ssize_t __pyx_t_140;
  Py_ssize_t __pyx_t_141;
  Py_ssize_t __pyx_t_142;
  Py_ssize_t __pyx_t_143;
  Py_ssize_t __pyx_t_144;
  Py_ssize_t __pyx_t_145;
  Py_ssize_t __pyx_t_146;
  Py_ssize_t __pyx_t_147;
  Py_ssize_t __pyx_t_148;
  Py_ssize_t __pyx_t_149;
  Py_ssize_t __pyx_t_150;
  Py_ssize_t __pyx_t_151;
  Py_ssize_t __pyx_t_152;
  Py_ssize_t __pyx_t_153;
  Py_ssize_t __pyx_t_154;
  Py_ssize_t __pyx_t_155;
  Py_ssize_t __pyx_t_156;
  Py_ssize_t __pyx_t_157;
  Py_ssize_t __pyx_t_158;
  Py_ssize_t __pyx_t_159;
  Py_ssize_t __pyx_t_160;
  Py_ssize_t __pyx_t_161;
  Py_ssize_t __pyx_t_162;
  Py_ssize_t __pyx_t_163;
  Py_ssize_t __pyx_t_164;
  Py_ssize_t __pyx_t_165;
  Py_ssize_t __pyx_t_166;
  Py_ssize_t __pyx_t_167;
  Py_ssize_t __pyx_t_168;
  Py_ssize_t __pyx_t_169;
  Py_ssize_t __pyx_t_170;
  Py_ssize_t __pyx_t_171;
  struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_conj __pyx_t_172;
  Py_ssize_t __pyx_t_173;
  Py_ssize_t __pyx_t_174;
  Py_ssize_t __pyx_t_175;
  Py_ssize_t __pyx_t_176;
  Py_ssize_t __pyx_t_177;
  Py_ssize_t __pyx_t_178;
  Py_ssize_t __pyx_t_179;
  Py_ssize_t __pyx_t_180;
  Py_ssize_t __pyx_t_181;
  Py_ssize_t __pyx_t_182;
  Py_ssize_t __pyx_t_183;
  Py_ssize_t __pyx_t_184;
  int __pyx_t_185;
  __Pyx_memviewslice __pyx_t_186 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_187 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_188 = NULL;
  Py_ssize_t __pyx_t_189;
  Py_ssize_t __pyx_t_190;
  Py_ssize_t __pyx_t_191;
  Py_ssize_t __pyx_t_192;
  Py_ssize_t __pyx_t_193;
  Py_ssize_t __pyx_t_194;
  Py_ssize_t __pyx_t_195;
  Py_ssize_t __pyx_t_196;
  Py_ssize_t __pyx_t_197;
  Py_ssize_t __pyx_t_198;
  __Pyx_RefNannySetupContext("solve", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_user_action = __pyx_optional_args->user_action;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_version = __pyx_optional_args->version;
      }
    }
  }
  /* 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_solve); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_3solve)) {
      __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_ERR(0, 2632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_user_action);
      __Pyx_GIVEREF(__pyx_v_user_action);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_user_action);
      __Pyx_INCREF(__pyx_v_version);
      __Pyx_GIVEREF(__pyx_v_version);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_version);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2632, __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_t_7 = ((enum __pyx_t_9pylsewave_5cynum_SOLVER)__Pyx_PyInt_As_enum____pyx_t_9pylsewave_5cynum_SOLVER(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2632, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pylsewave/cynum.pyx":2636
 * 
 *         cdef Py_ssize_t length, len_x, i, j, n, i_bcs
 *         cdef double[::1] getarr = np.zeros(2, np.float)             # <<<<<<<<<<<<<<
 *         # array to store the wave speeds
 *         cdef double[::1] c_i
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_int_2);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_getarr = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2641
 *         cdef CFL res_cfl
 *         cdef SOLVER res_solver
 *         length = len(self.mesh.vessels)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t siz_i
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 2641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_length = __pyx_t_5;

  /* "pylsewave/cynum.pyx":2645
 *         cdef Py_ssize_t siz_i
 *         cdef vector[U] v_U
 *         v_U.resize(length)             # <<<<<<<<<<<<<<
 *         self.initialise_solution_vector(v_U, length)
 * 
 */
  try {
    __pyx_v_v_U.resize(__pyx_v_length);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2645, __pyx_L1_error)
  }

  /* "pylsewave/cynum.pyx":2646
 *         cdef vector[U] v_U
 *         v_U.resize(length)
 *         self.initialise_solution_vector(v_U, length)             # <<<<<<<<<<<<<<
 * 
 *         import time
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.initialise_solution_vector(((struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self), __pyx_v_v_U, __pyx_v_length);

  /* "pylsewave/cynum.pyx":2648
 *         self.initialise_solution_vector(v_U, length)
 * 
 *         import time             # <<<<<<<<<<<<<<
 *         t0 = time.clock()  # CPU time measurement
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_time = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":2649
 * 
 *         import time
 *         t0 = time.clock()  # CPU time measurement             # <<<<<<<<<<<<<<
 * 
 *         # --- Valid indices for space and time mesh ---
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_clock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2649, __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_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2649, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2649, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_t0 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":2653
 *         # --- Valid indices for space and time mesh ---
 *         # self._Ix = range(0, self._Nx + 1)
 *         self._It = np.arange(0, self._Nt + 1, dtype=np.int)             # <<<<<<<<<<<<<<
 * 
 *         self._dt = self._t[1] - self._t[0]
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->__pyx_base.__pyx_base._Nt + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_2);
  if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_XDEC_MEMVIEW(&__pyx_v_self->__pyx_base.__pyx_base._It, 0);
  __pyx_v_self->__pyx_base.__pyx_base._It = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "pylsewave/cynum.pyx":2655
 *         self._It = np.arange(0, self._Nt + 1, dtype=np.int)
 * 
 *         self._dt = self._t[1] - self._t[0]             # <<<<<<<<<<<<<<
 * 
 *         print("Solver set to dt=%0.9f" % self._dt)
 */
  __pyx_t_10 = 1;
  __pyx_t_11 = 0;
  __pyx_v_self->__pyx_base.__pyx_base._dt = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->__pyx_base.__pyx_base._t.data) + __pyx_t_10)) ))) - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->__pyx_base.__pyx_base._t.data) + __pyx_t_11)) ))));

  /* "pylsewave/cynum.pyx":2657
 *         self._dt = self._t[1] - self._t[0]
 * 
 *         print("Solver set to dt=%0.9f" % self._dt)             # <<<<<<<<<<<<<<
 * 
 *         cdef vector[cParabolicSolObj] parU
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base._dt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Solver_set_to_dt_0_9f, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PrintOne(0, __pyx_t_1) < 0) __PYX_ERR(0, 2657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":2660
 * 
 *         cdef vector[cParabolicSolObj] parU
 *         parU.resize(length)             # <<<<<<<<<<<<<<
 *         for i in range(length):
 *             N_n = self.mesh.vessels[i].r0.shape[0]
 */
  try {
    __pyx_v_parU.resize(__pyx_v_length);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2660, __pyx_L1_error)
  }

  /* "pylsewave/cynum.pyx":2661
 *         cdef vector[cParabolicSolObj] parU
 *         parU.resize(length)
 *         for i in range(length):             # <<<<<<<<<<<<<<
 *             N_n = self.mesh.vessels[i].r0.shape[0]
 *             parU[i].x_hyper = np.zeros((2, N_n), dtype=np.float)
 */
  __pyx_t_5 = __pyx_v_length;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_5; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pylsewave/cynum.pyx":2662
 *         parU.resize(length)
 *         for i in range(length):
 *             N_n = self.mesh.vessels[i].r0.shape[0]             # <<<<<<<<<<<<<<
 *             parU[i].x_hyper = np.zeros((2, N_n), dtype=np.float)
 *             parU[i].a = np.zeros(N_n-3, dtype=np.float)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_r0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_N_n, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pylsewave/cynum.pyx":2663
 *         for i in range(length):
 *             N_n = self.mesh.vessels[i].r0.shape[0]
 *             parU[i].x_hyper = np.zeros((2, N_n), dtype=np.float)             # <<<<<<<<<<<<<<
 *             parU[i].a = np.zeros(N_n-3, dtype=np.float)
 *             parU[i].b = np.zeros(N_n-2, dtype=np.float)
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_2);
    __Pyx_INCREF(__pyx_v_N_n);
    __Pyx_GIVEREF(__pyx_v_N_n);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_N_n);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __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;
    __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_6);
    if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 2663, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_parU[__pyx_v_i]).x_hyper, 0);
    (__pyx_v_parU[__pyx_v_i]).x_hyper = __pyx_t_13;
    __pyx_t_13.memview = NULL;
    __pyx_t_13.data = NULL;

    /* "pylsewave/cynum.pyx":2664
 *             N_n = self.mesh.vessels[i].r0.shape[0]
 *             parU[i].x_hyper = np.zeros((2, N_n), dtype=np.float)
 *             parU[i].a = np.zeros(N_n-3, dtype=np.float)             # <<<<<<<<<<<<<<
 *             parU[i].b = np.zeros(N_n-2, dtype=np.float)
 *             parU[i].c = np.zeros(N_n-3, dtype=np.float)
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_N_n, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 2664, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3);
    if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2664, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_parU[__pyx_v_i]).a, 0);
    (__pyx_v_parU[__pyx_v_i]).a = __pyx_t_8;
    __pyx_t_8.memview = NULL;
    __pyx_t_8.data = NULL;

    /* "pylsewave/cynum.pyx":2665
 *             parU[i].x_hyper = np.zeros((2, N_n), dtype=np.float)
 *             parU[i].a = np.zeros(N_n-3, dtype=np.float)
 *             parU[i].b = np.zeros(N_n-2, dtype=np.float)             # <<<<<<<<<<<<<<
 *             parU[i].c = np.zeros(N_n-3, dtype=np.float)
 *             parU[i].d = np.zeros(N_n, dtype=np.float)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_N_n, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 2665, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2665, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
    if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2665, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_parU[__pyx_v_i]).b, 0);
    (__pyx_v_parU[__pyx_v_i]).b = __pyx_t_8;
    __pyx_t_8.memview = NULL;
    __pyx_t_8.data = NULL;

    /* "pylsewave/cynum.pyx":2666
 *             parU[i].a = np.zeros(N_n-3, dtype=np.float)
 *             parU[i].b = np.zeros(N_n-2, dtype=np.float)
 *             parU[i].c = np.zeros(N_n-3, dtype=np.float)             # <<<<<<<<<<<<<<
 *             parU[i].d = np.zeros(N_n, dtype=np.float)
 *             parU[i].a_ph = np.zeros(N_n-2, dtype=np.float)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_N_n, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 2666, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
    if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2666, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_parU[__pyx_v_i]).c, 0);
    (__pyx_v_parU[__pyx_v_i]).c = __pyx_t_8;
    __pyx_t_8.memview = NULL;
    __pyx_t_8.data = NULL;

    /* "pylsewave/cynum.pyx":2667
 *             parU[i].b = np.zeros(N_n-2, dtype=np.float)
 *             parU[i].c = np.zeros(N_n-3, dtype=np.float)
 *             parU[i].d = np.zeros(N_n, dtype=np.float)             # <<<<<<<<<<<<<<
 *             parU[i].a_ph = np.zeros(N_n-2, dtype=np.float)
 *             parU[i].a_mh = np.zeros(N_n-2, dtype=np.float)
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __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_ERR(0, 2667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_N_n);
    __Pyx_GIVEREF(__pyx_v_N_n);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_N_n);
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 2667, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
    if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2667, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_parU[__pyx_v_i]).d, 0);
    (__pyx_v_parU[__pyx_v_i]).d = __pyx_t_8;
    __pyx_t_8.memview = NULL;
    __pyx_t_8.data = NULL;

    /* "pylsewave/cynum.pyx":2668
 *             parU[i].c = np.zeros(N_n-3, dtype=np.float)
 *             parU[i].d = np.zeros(N_n, dtype=np.float)
 *             parU[i].a_ph = np.zeros(N_n-2, dtype=np.float)             # <<<<<<<<<<<<<<
 *             parU[i].a_mh = np.zeros(N_n-2, dtype=np.float)
 * 
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_N_n, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3);
    if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_parU[__pyx_v_i]).a_ph, 0);
    (__pyx_v_parU[__pyx_v_i]).a_ph = __pyx_t_8;
    __pyx_t_8.memview = NULL;
    __pyx_t_8.data = NULL;

    /* "pylsewave/cynum.pyx":2669
 *             parU[i].d = np.zeros(N_n, dtype=np.float)
 *             parU[i].a_ph = np.zeros(N_n-2, dtype=np.float)
 *             parU[i].a_mh = np.zeros(N_n-2, dtype=np.float)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_N_n, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
    if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_XDEC_MEMVIEW(&(__pyx_v_parU[__pyx_v_i]).a_mh, 0);
    (__pyx_v_parU[__pyx_v_i]).a_mh = __pyx_t_8;
    __pyx_t_8.memview = NULL;
    __pyx_t_8.data = NULL;
  }

  /* "pylsewave/cynum.pyx":2673
 * 
 *         # check with nogil here
 *         for i in range(length):             # <<<<<<<<<<<<<<
 *             len_x = self.mesh.vessels[i].x.shape[0]
 *             for j in range(len_x):
 */
  __pyx_t_5 = __pyx_v_length;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_5; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pylsewave/cynum.pyx":2674
 *         # check with nogil here
 *         for i in range(length):
 *             len_x = self.mesh.vessels[i].x.shape[0]             # <<<<<<<<<<<<<<
 *             for j in range(len_x):
 *                 self._bcs.I(self.mesh.vessels[i].x[j], j, i, getarr)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2674, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_len_x = __pyx_t_14;

    /* "pylsewave/cynum.pyx":2675
 *         for i in range(length):
 *             len_x = self.mesh.vessels[i].x.shape[0]
 *             for j in range(len_x):             # <<<<<<<<<<<<<<
 *                 self._bcs.I(self.mesh.vessels[i].x[j], j, i, getarr)
 *                 v_U[i].u_n[0, j] = getarr[0]
 */
    __pyx_t_14 = __pyx_v_len_x;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "pylsewave/cynum.pyx":2676
 *             len_x = self.mesh.vessels[i].x.shape[0]
 *             for j in range(len_x):
 *                 self._bcs.I(self.mesh.vessels[i].x[j], j, i, getarr)             # <<<<<<<<<<<<<<
 *                 v_U[i].u_n[0, j] = getarr[0]
 *                 v_U[i].u_n[1, j] = getarr[1]
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2676, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2676, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2676, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2676, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2676, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_self->__pyx_base.__pyx_base._bcs->__pyx_vtab)->I(__pyx_v_self->__pyx_base.__pyx_base._bcs, __pyx_t_16, __pyx_v_j, __pyx_v_i, __pyx_v_getarr, 0);

      /* "pylsewave/cynum.pyx":2677
 *             for j in range(len_x):
 *                 self._bcs.I(self.mesh.vessels[i].x[j], j, i, getarr)
 *                 v_U[i].u_n[0, j] = getarr[0]             # <<<<<<<<<<<<<<
 *                 v_U[i].u_n[1, j] = getarr[1]
 * 
 */
      __pyx_t_17 = 0;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_18 = 0;
      __pyx_t_19 = __pyx_v_j;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_18 * __pyx_t_13.strides[0]) )) + __pyx_t_19)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_getarr.data) + __pyx_t_17)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2678
 *                 self._bcs.I(self.mesh.vessels[i].x[j], j, i, getarr)
 *                 v_U[i].u_n[0, j] = getarr[0]
 *                 v_U[i].u_n[1, j] = getarr[1]             # <<<<<<<<<<<<<<
 * 
 *                 # check cfl condition
 */
      __pyx_t_20 = 1;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_21 = 1;
      __pyx_t_22 = __pyx_v_j;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_21 * __pyx_t_13.strides[0]) )) + __pyx_t_22)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_getarr.data) + __pyx_t_20)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2681
 * 
 *                 # check cfl condition
 *                 res_cfl = self.cfl_i(getarr, v_U[i].dx, self._dt, j, i)             # <<<<<<<<<<<<<<
 *                 if res_cfl == CFL.CFL_STATUS_ERROR:
 *                     return SOLVER.SOLVER_STATUS_ERROR
 */
      __pyx_v_res_cfl = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.cfl_i(((struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self), __pyx_v_getarr, (__pyx_v_v_U[__pyx_v_i]).dx, __pyx_v_self->__pyx_base.__pyx_base._dt, __pyx_v_j, __pyx_v_i);

      /* "pylsewave/cynum.pyx":2682
 *                 # check cfl condition
 *                 res_cfl = self.cfl_i(getarr, v_U[i].dx, self._dt, j, i)
 *                 if res_cfl == CFL.CFL_STATUS_ERROR:             # <<<<<<<<<<<<<<
 *                     return SOLVER.SOLVER_STATUS_ERROR
 * 
 */
      __pyx_t_23 = ((__pyx_v_res_cfl == __pyx_e_9pylsewave_5cynum_CFL_STATUS_ERROR) != 0);
      if (__pyx_t_23) {

        /* "pylsewave/cynum.pyx":2683
 *                 res_cfl = self.cfl_i(getarr, v_U[i].dx, self._dt, j, i)
 *                 if res_cfl == CFL.CFL_STATUS_ERROR:
 *                     return SOLVER.SOLVER_STATUS_ERROR             # <<<<<<<<<<<<<<
 * 
 *                 if user_action is not None:
 */
        __pyx_r = __pyx_e_9pylsewave_5cynum_SOLVER_STATUS_ERROR;
        goto __pyx_L0;

        /* "pylsewave/cynum.pyx":2682
 *                 # check cfl condition
 *                 res_cfl = self.cfl_i(getarr, v_U[i].dx, self._dt, j, i)
 *                 if res_cfl == CFL.CFL_STATUS_ERROR:             # <<<<<<<<<<<<<<
 *                     return SOLVER.SOLVER_STATUS_ERROR
 * 
 */
      }

      /* "pylsewave/cynum.pyx":2685
 *                     return SOLVER.SOLVER_STATUS_ERROR
 * 
 *                 if user_action is not None:             # <<<<<<<<<<<<<<
 *                     p = self._pdes.pressure_i(getarr[0], j, vessel_index=i)
 * 
 */
      __pyx_t_23 = (__pyx_v_user_action != Py_None);
      __pyx_t_24 = (__pyx_t_23 != 0);
      if (__pyx_t_24) {

        /* "pylsewave/cynum.pyx":2686
 * 
 *                 if user_action is not None:
 *                     p = self._pdes.pressure_i(getarr[0], j, vessel_index=i)             # <<<<<<<<<<<<<<
 * 
 *                     v_U[i].u_store[0, j] = v_U[i].u_n[0, j]
 */
        __pyx_t_25 = 0;
        __pyx_v_p = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm *)__pyx_v_self->__pyx_base.__pyx_base._pdes->__pyx_vtab)->pressure_i(__pyx_v_self->__pyx_base.__pyx_base._pdes, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_getarr.data) + __pyx_t_25)) ))), __pyx_v_j, __pyx_v_i);

        /* "pylsewave/cynum.pyx":2688
 *                     p = self._pdes.pressure_i(getarr[0], j, vessel_index=i)
 * 
 *                     v_U[i].u_store[0, j] = v_U[i].u_n[0, j]             # <<<<<<<<<<<<<<
 *                     v_U[i].u_store[1, j] = v_U[i].u_n[1, j]
 *                     v_U[i].u_store[2, j] = p
 */
        __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u_n;
        __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
        __pyx_t_26 = 0;
        __pyx_t_27 = __pyx_v_j;
        __pyx_t_28 = (__pyx_v_v_U[__pyx_v_i]).u_store;
        __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
        __pyx_t_29 = 0;
        __pyx_t_30 = __pyx_v_j;
        *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_28.data + __pyx_t_29 * __pyx_t_28.strides[0]) )) + __pyx_t_30)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_26 * __pyx_t_13.strides[0]) )) + __pyx_t_27)) )));
        __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
        __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

        /* "pylsewave/cynum.pyx":2689
 * 
 *                     v_U[i].u_store[0, j] = v_U[i].u_n[0, j]
 *                     v_U[i].u_store[1, j] = v_U[i].u_n[1, j]             # <<<<<<<<<<<<<<
 *                     v_U[i].u_store[2, j] = p
 * 
 */
        __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u_n;
        __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
        __pyx_t_31 = 1;
        __pyx_t_32 = __pyx_v_j;
        __pyx_t_28 = (__pyx_v_v_U[__pyx_v_i]).u_store;
        __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
        __pyx_t_33 = 1;
        __pyx_t_34 = __pyx_v_j;
        *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_28.data + __pyx_t_33 * __pyx_t_28.strides[0]) )) + __pyx_t_34)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_31 * __pyx_t_13.strides[0]) )) + __pyx_t_32)) )));
        __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
        __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

        /* "pylsewave/cynum.pyx":2690
 *                     v_U[i].u_store[0, j] = v_U[i].u_n[0, j]
 *                     v_U[i].u_store[1, j] = v_U[i].u_n[1, j]
 *                     v_U[i].u_store[2, j] = p             # <<<<<<<<<<<<<<
 * 
 *             if user_action is not None:
 */
        __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u_store;
        __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
        __pyx_t_35 = 2;
        __pyx_t_36 = __pyx_v_j;
        *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_35 * __pyx_t_13.strides[0]) )) + __pyx_t_36)) )) = __pyx_v_p;
        __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

        /* "pylsewave/cynum.pyx":2685
 *                     return SOLVER.SOLVER_STATUS_ERROR
 * 
 *                 if user_action is not None:             # <<<<<<<<<<<<<<
 *                     p = self._pdes.pressure_i(getarr[0], j, vessel_index=i)
 * 
 */
      }
    }

    /* "pylsewave/cynum.pyx":2692
 *                     v_U[i].u_store[2, j] = p
 * 
 *             if user_action is not None:             # <<<<<<<<<<<<<<
 *                 user_action(v_U[i].u_store, self.mesh.vessels[i].x, self._t, 0, PRINT_STATUS, WRITE_STATUS, i)
 *                 # cwrite2file("./run_cases/.tmpdata__u_%010d__vessel_%03d.dat" % (0, i), v_U[i].u_store)
 */
    __pyx_t_24 = (__pyx_v_user_action != Py_None);
    __pyx_t_23 = (__pyx_t_24 != 0);
    if (__pyx_t_23) {

      /* "pylsewave/cynum.pyx":2693
 * 
 *             if user_action is not None:
 *                 user_action(v_U[i].u_store, self.mesh.vessels[i].x, self._t, 0, PRINT_STATUS, WRITE_STATUS, i)             # <<<<<<<<<<<<<<
 *                 # cwrite2file("./run_cases/.tmpdata__u_%010d__vessel_%03d.dat" % (0, i), v_U[i].u_store)
 *                 # cwrite2file("./run_cases/.tmpdata__t.dat", np.reshape(self._t, (1, self._t.shape[0])))
 */
      __pyx_t_2 = __pyx_memoryview_fromslice((__pyx_v_v_U[__pyx_v_i]).u_store, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_self->__pyx_base.__pyx_base._t, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PRINT_STATUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_WRITE_STATUS); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_37);
      __pyx_t_38 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_38);
      __Pyx_INCREF(__pyx_v_user_action);
      __pyx_t_39 = __pyx_v_user_action; __pyx_t_40 = NULL;
      __pyx_t_14 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_39))) {
        __pyx_t_40 = PyMethod_GET_SELF(__pyx_t_39);
        if (likely(__pyx_t_40)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_39);
          __Pyx_INCREF(__pyx_t_40);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_39, function);
          __pyx_t_14 = 1;
        }
      }
      __pyx_t_41 = PyTuple_New(7+__pyx_t_14); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_41);
      if (__pyx_t_40) {
        __Pyx_GIVEREF(__pyx_t_40); PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_t_40); __pyx_t_40 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_41, 0+__pyx_t_14, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_41, 1+__pyx_t_14, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_41, 2+__pyx_t_14, __pyx_t_6);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_41, 3+__pyx_t_14, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_41, 4+__pyx_t_14, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_37);
      PyTuple_SET_ITEM(__pyx_t_41, 5+__pyx_t_14, __pyx_t_37);
      __Pyx_GIVEREF(__pyx_t_38);
      PyTuple_SET_ITEM(__pyx_t_41, 6+__pyx_t_14, __pyx_t_38);
      __pyx_t_2 = 0;
      __pyx_t_1 = 0;
      __pyx_t_6 = 0;
      __pyx_t_4 = 0;
      __pyx_t_37 = 0;
      __pyx_t_38 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_39, __pyx_t_41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
      __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pylsewave/cynum.pyx":2692
 *                     v_U[i].u_store[2, j] = p
 * 
 *             if user_action is not None:             # <<<<<<<<<<<<<<
 *                 user_action(v_U[i].u_store, self.mesh.vessels[i].x, self._t, 0, PRINT_STATUS, WRITE_STATUS, i)
 *                 # cwrite2file("./run_cases/.tmpdata__u_%010d__vessel_%03d.dat" % (0, i), v_U[i].u_store)
 */
    }
  }

  /* "pylsewave/cynum.pyx":2703
 *         cdef int index, siz_U0, k, siz_UL, siz_UBif, siz_UConj, par, d1, d2
 *         cdef double[::1] u_nmp1, x_n, u_nmp1_conj, x_n_conj
 *         u_nmp1 = np.zeros(6, np.float)             # <<<<<<<<<<<<<<
 *         x_n = np.zeros(6, np.float)
 *         u_nmp1_conj = np.zeros(4, np.float)
 */
  __pyx_t_39 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_39, __pyx_n_s_zeros); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __pyx_t_39 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_39, __pyx_n_s_float); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __pyx_t_39 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_41))) {
    __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_41);
    if (likely(__pyx_t_39)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_41);
      __Pyx_INCREF(__pyx_t_39);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_41, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_37 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (__pyx_t_39) {
    __Pyx_GIVEREF(__pyx_t_39); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_39); __pyx_t_39 = NULL;
  }
  __Pyx_INCREF(__pyx_int_6);
  __Pyx_GIVEREF(__pyx_int_6);
  PyTuple_SET_ITEM(__pyx_t_37, 0+__pyx_t_5, __pyx_int_6);
  __Pyx_GIVEREF(__pyx_t_38);
  PyTuple_SET_ITEM(__pyx_t_37, 1+__pyx_t_5, __pyx_t_38);
  __pyx_t_38 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_41, __pyx_t_37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2703, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_u_nmp1 = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2704
 *         cdef double[::1] u_nmp1, x_n, u_nmp1_conj, x_n_conj
 *         u_nmp1 = np.zeros(6, np.float)
 *         x_n = np.zeros(6, np.float)             # <<<<<<<<<<<<<<
 *         u_nmp1_conj = np.zeros(4, np.float)
 *         x_n_conj = np.zeros(4, np.float)
 */
  __pyx_t_41 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_zeros); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_float); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_41 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_37))) {
    __pyx_t_41 = PyMethod_GET_SELF(__pyx_t_37);
    if (likely(__pyx_t_41)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_37);
      __Pyx_INCREF(__pyx_t_41);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_37, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_39 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  if (__pyx_t_41) {
    __Pyx_GIVEREF(__pyx_t_41); PyTuple_SET_ITEM(__pyx_t_39, 0, __pyx_t_41); __pyx_t_41 = NULL;
  }
  __Pyx_INCREF(__pyx_int_6);
  __Pyx_GIVEREF(__pyx_int_6);
  PyTuple_SET_ITEM(__pyx_t_39, 0+__pyx_t_5, __pyx_int_6);
  __Pyx_GIVEREF(__pyx_t_38);
  PyTuple_SET_ITEM(__pyx_t_39, 1+__pyx_t_5, __pyx_t_38);
  __pyx_t_38 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_37, __pyx_t_39, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_x_n = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2705
 *         u_nmp1 = np.zeros(6, np.float)
 *         x_n = np.zeros(6, np.float)
 *         u_nmp1_conj = np.zeros(4, np.float)             # <<<<<<<<<<<<<<
 *         x_n_conj = np.zeros(4, np.float)
 *         cdef int last_index, first_index, iter_count
 */
  __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_39 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_zeros); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_float); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_39))) {
    __pyx_t_37 = PyMethod_GET_SELF(__pyx_t_39);
    if (likely(__pyx_t_37)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_39);
      __Pyx_INCREF(__pyx_t_37);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_39, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_41 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  if (__pyx_t_37) {
    __Pyx_GIVEREF(__pyx_t_37); PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_t_37); __pyx_t_37 = NULL;
  }
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyTuple_SET_ITEM(__pyx_t_41, 0+__pyx_t_5, __pyx_int_4);
  __Pyx_GIVEREF(__pyx_t_38);
  PyTuple_SET_ITEM(__pyx_t_41, 1+__pyx_t_5, __pyx_t_38);
  __pyx_t_38 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_39, __pyx_t_41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_u_nmp1_conj = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2706
 *         x_n = np.zeros(6, np.float)
 *         u_nmp1_conj = np.zeros(4, np.float)
 *         x_n_conj = np.zeros(4, np.float)             # <<<<<<<<<<<<<<
 *         cdef int last_index, first_index, iter_count
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)
 */
  __pyx_t_39 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_39, __pyx_n_s_zeros); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __pyx_t_39 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_39);
  __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_39, __pyx_n_s_float); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
  __pyx_t_39 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_41))) {
    __pyx_t_39 = PyMethod_GET_SELF(__pyx_t_41);
    if (likely(__pyx_t_39)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_41);
      __Pyx_INCREF(__pyx_t_39);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_41, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_37 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  if (__pyx_t_39) {
    __Pyx_GIVEREF(__pyx_t_39); PyTuple_SET_ITEM(__pyx_t_37, 0, __pyx_t_39); __pyx_t_39 = NULL;
  }
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyTuple_SET_ITEM(__pyx_t_37, 0+__pyx_t_5, __pyx_int_4);
  __Pyx_GIVEREF(__pyx_t_38);
  PyTuple_SET_ITEM(__pyx_t_37, 1+__pyx_t_5, __pyx_t_38);
  __pyx_t_38 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_41, __pyx_t_37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_x_n_conj = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2708
 *         x_n_conj = np.zeros(4, np.float)
 *         cdef int last_index, first_index, iter_count
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)             # <<<<<<<<<<<<<<
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)
 *         siz_U0 = self.U0_arr.shape[0]
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_37, __pyx_n_s_int); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_38) < 0) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
  __pyx_t_38 = __Pyx_PyObject_Call(__pyx_t_41, __pyx_tuple__14, __pyx_t_3); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_38);
  if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
  __pyx_v_bif_list = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "pylsewave/cynum.pyx":2709
 *         cdef int last_index, first_index, iter_count
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)             # <<<<<<<<<<<<<<
 *         siz_U0 = self.U0_arr.shape[0]
 *         siz_UL = self.UL_arr.shape[0]
 */
  __pyx_t_38 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
  __pyx_t_38 = PyDict_New(); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_38);
  __pyx_t_41 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_41);
  __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_41, __pyx_n_s_int); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
  if (PyDict_SetItem(__pyx_t_38, __pyx_n_s_dtype, __pyx_t_37) < 0) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_t_37 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, __pyx_t_38); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_37);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_37);
  if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
  __pyx_v_conj_list = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "pylsewave/cynum.pyx":2710
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)
 *         siz_U0 = self.U0_arr.shape[0]             # <<<<<<<<<<<<<<
 *         siz_UL = self.UL_arr.shape[0]
 *         siz_UBif = self.UBif_arr.shape[0]
 */
  __pyx_v_siz_U0 = (__pyx_v_self->__pyx_base.__pyx_base.U0_arr.shape[0]);

  /* "pylsewave/cynum.pyx":2711
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)
 *         siz_U0 = self.U0_arr.shape[0]
 *         siz_UL = self.UL_arr.shape[0]             # <<<<<<<<<<<<<<
 *         siz_UBif = self.UBif_arr.shape[0]
 *         siz_UConj = self.UConj_arr.shape[0]
 */
  __pyx_v_siz_UL = (__pyx_v_self->__pyx_base.__pyx_base.UL_arr.shape[0]);

  /* "pylsewave/cynum.pyx":2712
 *         siz_U0 = self.U0_arr.shape[0]
 *         siz_UL = self.UL_arr.shape[0]
 *         siz_UBif = self.UBif_arr.shape[0]             # <<<<<<<<<<<<<<
 *         siz_UConj = self.UConj_arr.shape[0]
 * 
 */
  __pyx_v_siz_UBif = (__pyx_v_self->__pyx_base.__pyx_base.UBif_arr.shape[0]);

  /* "pylsewave/cynum.pyx":2713
 *         siz_UL = self.UL_arr.shape[0]
 *         siz_UBif = self.UBif_arr.shape[0]
 *         siz_UConj = self.UConj_arr.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         #range [1 , self._Nt + 1]
 */
  __pyx_v_siz_UConj = (__pyx_v_self->__pyx_base.__pyx_base.UConj_arr.shape[0]);

  /* "pylsewave/cynum.pyx":2716
 * 
 *         #range [1 , self._Nt + 1]
 *         for n in range(1, self._Nt + 1):             # <<<<<<<<<<<<<<
 *             # this needs to be parallel
 *             # with nogil, parallel(num_threads=8):
 */
  __pyx_t_42 = (__pyx_v_self->__pyx_base.__pyx_base._Nt + 1);
  for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_42; __pyx_t_5+=1) {
    __pyx_v_n = __pyx_t_5;

    /* "pylsewave/cynum.pyx":2719
 *             # this needs to be parallel
 *             # with nogil, parallel(num_threads=8):
 *             for i in prange(length, nogil=True):             # <<<<<<<<<<<<<<
 *             # for i in range(length):
 *                 self.advance(v_U[i], self._dt, v_U[i].dx, i)
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {
          __pyx_t_12 = __pyx_v_length;
          if (1 == 0) abort();
          {
              #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                  #undef likely
                  #undef unlikely
                  #define likely(x)   (x)
                  #define unlikely(x) (x)
              #endif
              __pyx_t_15 = (__pyx_t_12 - 0 + 1 - 1/abs(1)) / 1;
              if (__pyx_t_15 > 0)
              {
                  #ifdef _OPENMP
                  #pragma omp parallel
                  #endif /* _OPENMP */
                  {
                      #ifdef _OPENMP
                      #pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i)
                      #endif /* _OPENMP */
                      for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_15; __pyx_t_14++){
                          {
                              __pyx_v_i = (Py_ssize_t)(0 + 1 * __pyx_t_14);

                              /* "pylsewave/cynum.pyx":2721
 *             for i in prange(length, nogil=True):
 *             # for i in range(length):
 *                 self.advance(v_U[i], self._dt, v_U[i].dx, i)             # <<<<<<<<<<<<<<
 * 
 * #             # Insert boundary conditions
 */
                              ((struct __pyx_vtabstruct_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.advance(((struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self), (__pyx_v_v_U[__pyx_v_i]), __pyx_v_self->__pyx_base.__pyx_base._dt, (__pyx_v_v_U[__pyx_v_i]).dx, __pyx_v_i);
                          }
                      }
                  }
              }
          }
          #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
              #undef likely
              #undef unlikely
              #define likely(x)   __builtin_expect(!!(x), 1)
              #define unlikely(x) __builtin_expect(!!(x), 0)
          #endif
        }

        /* "pylsewave/cynum.pyx":2719
 *             # this needs to be parallel
 *             # with nogil, parallel(num_threads=8):
 *             for i in prange(length, nogil=True):             # <<<<<<<<<<<<<<
 *             # for i in range(length):
 *                 self.advance(v_U[i], self._dt, v_U[i].dx, i)
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L18;
          }
          __pyx_L18:;
        }
    }

    /* "pylsewave/cynum.pyx":2725
 * #             # Insert boundary conditions
 * #             i_bcs = 0# self._Ix[0]
 *             for index in range(siz_U0):             # <<<<<<<<<<<<<<
 *                 k = self.U0_arr[index]
 *                 self._bcs.U_0(v_U[k].u_n, self._t[n], v_U[k].dx, self._dt, k, v_U[k].u)
 */
    __pyx_t_43 = __pyx_v_siz_U0;
    for (__pyx_t_44 = 0; __pyx_t_44 < __pyx_t_43; __pyx_t_44+=1) {
      __pyx_v_index = __pyx_t_44;

      /* "pylsewave/cynum.pyx":2726
 * #             i_bcs = 0# self._Ix[0]
 *             for index in range(siz_U0):
 *                 k = self.U0_arr[index]             # <<<<<<<<<<<<<<
 *                 self._bcs.U_0(v_U[k].u_n, self._t[n], v_U[k].dx, self._dt, k, v_U[k].u)
 * 
 */
      __pyx_t_45 = __pyx_v_index;
      __pyx_v_k = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->__pyx_base.__pyx_base.U0_arr.data) + __pyx_t_45)) )));

      /* "pylsewave/cynum.pyx":2727
 *             for index in range(siz_U0):
 *                 k = self.U0_arr[index]
 *                 self._bcs.U_0(v_U[k].u_n, self._t[n], v_U[k].dx, self._dt, k, v_U[k].u)             # <<<<<<<<<<<<<<
 * 
 *             # with nogil, parallel(num_threads=8):
 */
      __pyx_t_46 = __pyx_v_n;
      ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_self->__pyx_base.__pyx_base._bcs->__pyx_vtab)->U_0(__pyx_v_self->__pyx_base.__pyx_base._bcs, (__pyx_v_v_U[__pyx_v_k]).u_n, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->__pyx_base.__pyx_base._t.data) + __pyx_t_46)) ))), (__pyx_v_v_U[__pyx_v_k]).dx, __pyx_v_self->__pyx_base.__pyx_base._dt, __pyx_v_k, (__pyx_v_v_U[__pyx_v_k]).u, 0);
    }

    /* "pylsewave/cynum.pyx":2730
 * 
 *             # with nogil, parallel(num_threads=8):
 *             for index in prange(siz_UL, nogil=True):             # <<<<<<<<<<<<<<
 *             # for index in range(siz_UL):
 *             #         k = self.UL_arr[index]
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {
          __pyx_t_43 = __pyx_v_siz_UL;
          if (1 == 0) abort();
          {
              int __pyx_parallel_temp0 = 0xbad0bad0;
              const char *__pyx_parallel_filename = NULL; int __pyx_parallel_lineno = 0, __pyx_parallel_clineno = 0;
              PyObject *__pyx_parallel_exc_type = NULL, *__pyx_parallel_exc_value = NULL, *__pyx_parallel_exc_tb = NULL;
              int __pyx_parallel_why;
              __pyx_parallel_why = 0;
              #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
                  #undef likely
                  #undef unlikely
                  #define likely(x)   (x)
                  #define unlikely(x) (x)
              #endif
              __pyx_t_47 = (__pyx_t_43 - 0 + 1 - 1/abs(1)) / 1;
              if (__pyx_t_47 > 0)
              {
                  #ifdef _OPENMP
                  #pragma omp parallel private(__pyx_t_48, __pyx_t_49, __pyx_t_50, __pyx_t_51, __pyx_t_52) private(__pyx_filename, __pyx_lineno, __pyx_clineno) shared(__pyx_parallel_why, __pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb)
                  #endif /* _OPENMP */
                  {
                      #ifdef _OPENMP
                      #ifdef WITH_THREAD
                      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                      #endif
                      Py_BEGIN_ALLOW_THREADS
                      #endif /* _OPENMP */
                      #ifdef _OPENMP
                      #pragma omp for firstprivate(__pyx_v_index) lastprivate(__pyx_v_index)
                      #endif /* _OPENMP */
                      for (__pyx_t_44 = 0; __pyx_t_44 < __pyx_t_47; __pyx_t_44++){
                          if (__pyx_parallel_why < 2)
                          {
                              __pyx_v_index = (int)(0 + 1 * __pyx_t_44);

                              /* "pylsewave/cynum.pyx":2733
 *             # for index in range(siz_UL):
 *             #         k = self.UL_arr[index]
 *                 self._bcs.U_L(v_U[self.UL_arr[index]].u_n, self._t[n], v_U[self.UL_arr[index]].dx,             # <<<<<<<<<<<<<<
 *                               self._dt, self.UL_arr[index], v_U[self.UL_arr[index]].u)
 * 
 */
                              __pyx_t_48 = __pyx_v_index;
                              __pyx_t_49 = __pyx_v_n;
                              __pyx_t_50 = __pyx_v_index;

                              /* "pylsewave/cynum.pyx":2734
 *             #         k = self.UL_arr[index]
 *                 self._bcs.U_L(v_U[self.UL_arr[index]].u_n, self._t[n], v_U[self.UL_arr[index]].dx,
 *                               self._dt, self.UL_arr[index], v_U[self.UL_arr[index]].u)             # <<<<<<<<<<<<<<
 * 
 *             #parallel siz_UBif
 */
                              __pyx_t_51 = __pyx_v_index;
                              __pyx_t_52 = __pyx_v_index;

                              /* "pylsewave/cynum.pyx":2733
 *             # for index in range(siz_UL):
 *             #         k = self.UL_arr[index]
 *                 self._bcs.U_L(v_U[self.UL_arr[index]].u_n, self._t[n], v_U[self.UL_arr[index]].dx,             # <<<<<<<<<<<<<<
 *                               self._dt, self.UL_arr[index], v_U[self.UL_arr[index]].u)
 * 
 */
                              ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_self->__pyx_base.__pyx_base._bcs->__pyx_vtab)->U_L(__pyx_v_self->__pyx_base.__pyx_base._bcs, (__pyx_v_v_U[(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->__pyx_base.__pyx_base.UL_arr.data) + __pyx_t_48)) )))]).u_n, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->__pyx_base.__pyx_base._t.data) + __pyx_t_49)) ))), (__pyx_v_v_U[(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->__pyx_base.__pyx_base.UL_arr.data) + __pyx_t_50)) )))]).dx, __pyx_v_self->__pyx_base.__pyx_base._dt, (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->__pyx_base.__pyx_base.UL_arr.data) + __pyx_t_51)) ))), (__pyx_v_v_U[(*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_self->__pyx_base.__pyx_base.UL_arr.data) + __pyx_t_52)) )))]).u); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2733, __pyx_L34_error)
                              goto __pyx_L37;
                              __pyx_L34_error:;
                              {
                                  #ifdef WITH_THREAD
                                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                                  #endif
                                  #ifdef _OPENMP
                                  #pragma omp flush(__pyx_parallel_exc_type)
                                  #endif /* _OPENMP */
                                  if (!__pyx_parallel_exc_type) {
                                    __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
                                    __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
                                    __Pyx_GOTREF(__pyx_parallel_exc_type);
                                  }
                                  #ifdef WITH_THREAD
                                  PyGILState_Release(__pyx_gilstate_save);
                                  #endif
                              }
                              __pyx_parallel_why = 4;
                              goto __pyx_L36;
                              __pyx_L36:;
                              #ifdef _OPENMP
                              #pragma omp critical(__pyx_parallel_lastprivates1)
                              #endif /* _OPENMP */
                              {
                                  __pyx_parallel_temp0 = __pyx_v_index;
                              }
                              __pyx_L37:;
                              #ifdef _OPENMP
                              #pragma omp flush(__pyx_parallel_why)
                              #endif /* _OPENMP */
                          }
                      }
                      #ifdef _OPENMP
                      Py_END_ALLOW_THREADS
                      #else
{
#ifdef WITH_THREAD
                      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                      #endif
                      #endif /* _OPENMP */
                      /* Clean up any temporaries */
                      #ifdef WITH_THREAD
                      PyGILState_Release(__pyx_gilstate_save);
                      #endif
                      #ifndef _OPENMP
}
#endif /* _OPENMP */
                  }
              }
              if (__pyx_parallel_exc_type) {
                /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
                __pyx_parallel_why = 4;
              }
              if (__pyx_parallel_why) {
                __pyx_v_index = __pyx_parallel_temp0;
                switch (__pyx_parallel_why) {
                      case 4:
                  {
                      #ifdef WITH_THREAD
                      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                      #endif
                      __Pyx_GIVEREF(__pyx_parallel_exc_type);
                      __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
                      __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
                      #ifdef WITH_THREAD
                      PyGILState_Release(__pyx_gilstate_save);
                      #endif
                  }
                  goto __pyx_L30_error;
                }
              }
          }
          #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
              #undef likely
              #undef unlikely
              #define likely(x)   __builtin_expect(!!(x), 1)
              #define unlikely(x) __builtin_expect(!!(x), 0)
          #endif
        }

        /* "pylsewave/cynum.pyx":2730
 * 
 *             # with nogil, parallel(num_threads=8):
 *             for index in prange(siz_UL, nogil=True):             # <<<<<<<<<<<<<<
 *             # for index in range(siz_UL):
 *             #         k = self.UL_arr[index]
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L31;
          }
          __pyx_L30_error: {
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L31:;
        }
    }

    /* "pylsewave/cynum.pyx":2737
 * 
 *             #parallel siz_UBif
 *             for index in range(siz_UBif):             # <<<<<<<<<<<<<<
 *             # for index in prange(siz_UBif, nogil=True):
 *                 par = self.UBif_arr[index, 0]
 */
    __pyx_t_47 = __pyx_v_siz_UBif;
    for (__pyx_t_44 = 0; __pyx_t_44 < __pyx_t_47; __pyx_t_44+=1) {
      __pyx_v_index = __pyx_t_44;

      /* "pylsewave/cynum.pyx":2739
 *             for index in range(siz_UBif):
 *             # for index in prange(siz_UBif, nogil=True):
 *                 par = self.UBif_arr[index, 0]             # <<<<<<<<<<<<<<
 *                 d1 = self.UBif_arr[index, 1]
 *                 d2 = self.UBif_arr[index, 2]
 */
      __pyx_t_53 = __pyx_v_index;
      __pyx_t_54 = 0;
      __pyx_v_par = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->__pyx_base.__pyx_base.UBif_arr.data + __pyx_t_53 * __pyx_v_self->__pyx_base.__pyx_base.UBif_arr.strides[0]) )) + __pyx_t_54)) )));

      /* "pylsewave/cynum.pyx":2740
 *             # for index in prange(siz_UBif, nogil=True):
 *                 par = self.UBif_arr[index, 0]
 *                 d1 = self.UBif_arr[index, 1]             # <<<<<<<<<<<<<<
 *                 d2 = self.UBif_arr[index, 2]
 *                 bif_list[0] = par
 */
      __pyx_t_55 = __pyx_v_index;
      __pyx_t_56 = 1;
      __pyx_v_d1 = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->__pyx_base.__pyx_base.UBif_arr.data + __pyx_t_55 * __pyx_v_self->__pyx_base.__pyx_base.UBif_arr.strides[0]) )) + __pyx_t_56)) )));

      /* "pylsewave/cynum.pyx":2741
 *                 par = self.UBif_arr[index, 0]
 *                 d1 = self.UBif_arr[index, 1]
 *                 d2 = self.UBif_arr[index, 2]             # <<<<<<<<<<<<<<
 *                 bif_list[0] = par
 *                 bif_list[1] = d1
 */
      __pyx_t_57 = __pyx_v_index;
      __pyx_t_58 = 2;
      __pyx_v_d2 = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->__pyx_base.__pyx_base.UBif_arr.data + __pyx_t_57 * __pyx_v_self->__pyx_base.__pyx_base.UBif_arr.strides[0]) )) + __pyx_t_58)) )));

      /* "pylsewave/cynum.pyx":2742
 *                 d1 = self.UBif_arr[index, 1]
 *                 d2 = self.UBif_arr[index, 2]
 *                 bif_list[0] = par             # <<<<<<<<<<<<<<
 *                 bif_list[1] = d1
 *                 bif_list[2] = d2
 */
      __pyx_t_59 = 0;
      *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_bif_list.data) + __pyx_t_59)) )) = __pyx_v_par;

      /* "pylsewave/cynum.pyx":2743
 *                 d2 = self.UBif_arr[index, 2]
 *                 bif_list[0] = par
 *                 bif_list[1] = d1             # <<<<<<<<<<<<<<
 *                 bif_list[2] = d2
 *                 u_nmp1[0], u_nmp1[1], u_nmp1[2], u_nmp1[3], u_nmp1[4], u_nmp1[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 */
      __pyx_t_60 = 1;
      *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_bif_list.data) + __pyx_t_60)) )) = __pyx_v_d1;

      /* "pylsewave/cynum.pyx":2744
 *                 bif_list[0] = par
 *                 bif_list[1] = d1
 *                 bif_list[2] = d2             # <<<<<<<<<<<<<<
 *                 u_nmp1[0], u_nmp1[1], u_nmp1[2], u_nmp1[3], u_nmp1[4], u_nmp1[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 x_n[0], x_n[1], x_n[2], x_n[3], x_n[4], x_n[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 */
      __pyx_t_61 = 2;
      *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_bif_list.data) + __pyx_t_61)) )) = __pyx_v_d2;

      /* "pylsewave/cynum.pyx":2745
 *                 bif_list[1] = d1
 *                 bif_list[2] = d2
 *                 u_nmp1[0], u_nmp1[1], u_nmp1[2], u_nmp1[3], u_nmp1[4], u_nmp1[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0             # <<<<<<<<<<<<<<
 *                 x_n[0], x_n[1], x_n[2], x_n[3], x_n[4], x_n[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[par].u.shape[1]
 */
      __pyx_t_16 = 0.0;
      __pyx_t_62 = 0.0;
      __pyx_t_63 = 0.0;
      __pyx_t_64 = 0.0;
      __pyx_t_65 = 0.0;
      __pyx_t_66 = 0.0;
      __pyx_t_67 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_67)) )) = __pyx_t_16;
      __pyx_t_68 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_68)) )) = __pyx_t_62;
      __pyx_t_69 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_69)) )) = __pyx_t_63;
      __pyx_t_70 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_70)) )) = __pyx_t_64;
      __pyx_t_71 = 4;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_71)) )) = __pyx_t_65;
      __pyx_t_72 = 5;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_72)) )) = __pyx_t_66;

      /* "pylsewave/cynum.pyx":2746
 *                 bif_list[2] = d2
 *                 u_nmp1[0], u_nmp1[1], u_nmp1[2], u_nmp1[3], u_nmp1[4], u_nmp1[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 x_n[0], x_n[1], x_n[2], x_n[3], x_n[4], x_n[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0             # <<<<<<<<<<<<<<
 *                 last_index = v_U[par].u.shape[1]
 *                 first_index = 0
 */
      __pyx_t_66 = 0.0;
      __pyx_t_65 = 0.0;
      __pyx_t_64 = 0.0;
      __pyx_t_63 = 0.0;
      __pyx_t_62 = 0.0;
      __pyx_t_16 = 0.0;
      __pyx_t_73 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_73)) )) = __pyx_t_66;
      __pyx_t_74 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_74)) )) = __pyx_t_65;
      __pyx_t_75 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_75)) )) = __pyx_t_64;
      __pyx_t_76 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_76)) )) = __pyx_t_63;
      __pyx_t_77 = 4;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_77)) )) = __pyx_t_62;
      __pyx_t_78 = 5;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_78)) )) = __pyx_t_16;

      /* "pylsewave/cynum.pyx":2747
 *                 u_nmp1[0], u_nmp1[1], u_nmp1[2], u_nmp1[3], u_nmp1[4], u_nmp1[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 x_n[0], x_n[1], x_n[2], x_n[3], x_n[4], x_n[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[par].u.shape[1]             # <<<<<<<<<<<<<<
 *                 first_index = 0
 *                 u_nmp1[0] = v_U[par].u[0, last_index - 2]
 */
      __pyx_v_last_index = ((__pyx_v_v_U[__pyx_v_par]).u.shape[1]);

      /* "pylsewave/cynum.pyx":2748
 *                 x_n[0], x_n[1], x_n[2], x_n[3], x_n[4], x_n[5] = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[par].u.shape[1]
 *                 first_index = 0             # <<<<<<<<<<<<<<
 *                 u_nmp1[0] = v_U[par].u[0, last_index - 2]
 *                 u_nmp1[1] = v_U[par].u[1, last_index - 2]
 */
      __pyx_v_first_index = 0;

      /* "pylsewave/cynum.pyx":2749
 *                 last_index = v_U[par].u.shape[1]
 *                 first_index = 0
 *                 u_nmp1[0] = v_U[par].u[0, last_index - 2]             # <<<<<<<<<<<<<<
 *                 u_nmp1[1] = v_U[par].u[1, last_index - 2]
 *                 # print v_U[par].u[1, last_index - 2]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_par]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_79 = 0;
      __pyx_t_80 = (__pyx_v_last_index - 2);
      __pyx_t_81 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_81)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_79 * __pyx_t_13.strides[0]) )) + __pyx_t_80)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2750
 *                 first_index = 0
 *                 u_nmp1[0] = v_U[par].u[0, last_index - 2]
 *                 u_nmp1[1] = v_U[par].u[1, last_index - 2]             # <<<<<<<<<<<<<<
 *                 # print v_U[par].u[1, last_index - 2]
 *                 x_n[0] = v_U[par].u_n[0, last_index - 1]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_par]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_82 = 1;
      __pyx_t_83 = (__pyx_v_last_index - 2);
      __pyx_t_84 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_84)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_82 * __pyx_t_13.strides[0]) )) + __pyx_t_83)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2752
 *                 u_nmp1[1] = v_U[par].u[1, last_index - 2]
 *                 # print v_U[par].u[1, last_index - 2]
 *                 x_n[0] = v_U[par].u_n[0, last_index - 1]             # <<<<<<<<<<<<<<
 *                 x_n[1] = v_U[par].u_n[1, last_index - 1]
 *                 u_nmp1[2] = v_U[d1].u[0, first_index + 1]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_par]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_85 = 0;
      __pyx_t_86 = (__pyx_v_last_index - 1);
      __pyx_t_87 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_87)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_85 * __pyx_t_13.strides[0]) )) + __pyx_t_86)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2753
 *                 # print v_U[par].u[1, last_index - 2]
 *                 x_n[0] = v_U[par].u_n[0, last_index - 1]
 *                 x_n[1] = v_U[par].u_n[1, last_index - 1]             # <<<<<<<<<<<<<<
 *                 u_nmp1[2] = v_U[d1].u[0, first_index + 1]
 *                 u_nmp1[3] = v_U[d1].u[1, first_index + 1]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_par]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_88 = 1;
      __pyx_t_89 = (__pyx_v_last_index - 1);
      __pyx_t_90 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_90)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_88 * __pyx_t_13.strides[0]) )) + __pyx_t_89)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2754
 *                 x_n[0] = v_U[par].u_n[0, last_index - 1]
 *                 x_n[1] = v_U[par].u_n[1, last_index - 1]
 *                 u_nmp1[2] = v_U[d1].u[0, first_index + 1]             # <<<<<<<<<<<<<<
 *                 u_nmp1[3] = v_U[d1].u[1, first_index + 1]
 *                 x_n[2] = v_U[d1].u_n[0, first_index]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_91 = 0;
      __pyx_t_92 = (__pyx_v_first_index + 1);
      __pyx_t_93 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_93)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_91 * __pyx_t_13.strides[0]) )) + __pyx_t_92)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2755
 *                 x_n[1] = v_U[par].u_n[1, last_index - 1]
 *                 u_nmp1[2] = v_U[d1].u[0, first_index + 1]
 *                 u_nmp1[3] = v_U[d1].u[1, first_index + 1]             # <<<<<<<<<<<<<<
 *                 x_n[2] = v_U[d1].u_n[0, first_index]
 *                 x_n[3] = v_U[d1].u_n[1, first_index]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_94 = 1;
      __pyx_t_95 = (__pyx_v_first_index + 1);
      __pyx_t_96 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_96)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_94 * __pyx_t_13.strides[0]) )) + __pyx_t_95)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2756
 *                 u_nmp1[2] = v_U[d1].u[0, first_index + 1]
 *                 u_nmp1[3] = v_U[d1].u[1, first_index + 1]
 *                 x_n[2] = v_U[d1].u_n[0, first_index]             # <<<<<<<<<<<<<<
 *                 x_n[3] = v_U[d1].u_n[1, first_index]
 *                 u_nmp1[4] = v_U[d2].u[0, first_index + 1]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_97 = 0;
      __pyx_t_98 = __pyx_v_first_index;
      __pyx_t_99 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_99)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_97 * __pyx_t_13.strides[0]) )) + __pyx_t_98)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2757
 *                 u_nmp1[3] = v_U[d1].u[1, first_index + 1]
 *                 x_n[2] = v_U[d1].u_n[0, first_index]
 *                 x_n[3] = v_U[d1].u_n[1, first_index]             # <<<<<<<<<<<<<<
 *                 u_nmp1[4] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1[5] = v_U[d2].u[1, first_index + 1]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_100 = 1;
      __pyx_t_101 = __pyx_v_first_index;
      __pyx_t_102 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_102)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_100 * __pyx_t_13.strides[0]) )) + __pyx_t_101)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2758
 *                 x_n[2] = v_U[d1].u_n[0, first_index]
 *                 x_n[3] = v_U[d1].u_n[1, first_index]
 *                 u_nmp1[4] = v_U[d2].u[0, first_index + 1]             # <<<<<<<<<<<<<<
 *                 u_nmp1[5] = v_U[d2].u[1, first_index + 1]
 *                 x_n[4] = v_U[d2].u_n[0, first_index]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_103 = 0;
      __pyx_t_104 = (__pyx_v_first_index + 1);
      __pyx_t_105 = 4;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_105)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_103 * __pyx_t_13.strides[0]) )) + __pyx_t_104)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2759
 *                 x_n[3] = v_U[d1].u_n[1, first_index]
 *                 u_nmp1[4] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1[5] = v_U[d2].u[1, first_index + 1]             # <<<<<<<<<<<<<<
 *                 x_n[4] = v_U[d2].u_n[0, first_index]
 *                 x_n[5] = v_U[d2].u_n[1, first_index]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_106 = 1;
      __pyx_t_107 = (__pyx_v_first_index + 1);
      __pyx_t_108 = 5;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1.data) + __pyx_t_108)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_106 * __pyx_t_13.strides[0]) )) + __pyx_t_107)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2760
 *                 u_nmp1[4] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1[5] = v_U[d2].u[1, first_index + 1]
 *                 x_n[4] = v_U[d2].u_n[0, first_index]             # <<<<<<<<<<<<<<
 *                 x_n[5] = v_U[d2].u_n[1, first_index]
 * 
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_109 = 0;
      __pyx_t_110 = __pyx_v_first_index;
      __pyx_t_111 = 4;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_111)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_109 * __pyx_t_13.strides[0]) )) + __pyx_t_110)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2761
 *                 u_nmp1[5] = v_U[d2].u[1, first_index + 1]
 *                 x_n[4] = v_U[d2].u_n[0, first_index]
 *                 x_n[5] = v_U[d2].u_n[1, first_index]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_112 = 1;
      __pyx_t_113 = __pyx_v_first_index;
      __pyx_t_114 = 5;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_114)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_112 * __pyx_t_13.strides[0]) )) + __pyx_t_113)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2765
 * 
 *                 # return SOLVER.SOLVER_STATUS_ERROR
 *                 iter_count = Newton_Raphson_Sys_bif(self._bcs, x_n, u_nmp1, self._dt,             # <<<<<<<<<<<<<<
 *                                                     bif_list, 1.0e-9, 100)
 * 
 */
      __pyx_t_37 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._bcs);
      __Pyx_INCREF(__pyx_t_37);

      /* "pylsewave/cynum.pyx":2766
 *                 # return SOLVER.SOLVER_STATUS_ERROR
 *                 iter_count = Newton_Raphson_Sys_bif(self._bcs, x_n, u_nmp1, self._dt,
 *                                                     bif_list, 1.0e-9, 100)             # <<<<<<<<<<<<<<
 * 
 *                 # print iter_count
 */
      __pyx_t_115.__pyx_n = 1;
      __pyx_t_115.N = 0x64;
      __pyx_t_43 = __pyx_f_9pylsewave_5cynum_Newton_Raphson_Sys_bif(((struct __pyx_obj_9pylsewave_5cynum_cBCs *)__pyx_t_37), __pyx_v_x_n, __pyx_v_u_nmp1, __pyx_v_self->__pyx_base.__pyx_base._dt, __pyx_v_bif_list, 1.0e-9, &__pyx_t_115); 
      __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
      __pyx_v_iter_count = __pyx_t_43;

      /* "pylsewave/cynum.pyx":2769
 * 
 *                 # print iter_count
 *                 v_U[par].u[0, last_index - 1] = x_n[0]             # <<<<<<<<<<<<<<
 *                 v_U[par].u[1, last_index - 1] = x_n[1]
 *                 v_U[d1].u[0, 0] = x_n[2]
 */
      __pyx_t_116 = 0;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_par]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_117 = 0;
      __pyx_t_118 = (__pyx_v_last_index - 1);
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_117 * __pyx_t_13.strides[0]) )) + __pyx_t_118)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_116)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2770
 *                 # print iter_count
 *                 v_U[par].u[0, last_index - 1] = x_n[0]
 *                 v_U[par].u[1, last_index - 1] = x_n[1]             # <<<<<<<<<<<<<<
 *                 v_U[d1].u[0, 0] = x_n[2]
 *                 v_U[d1].u[1, 0] = x_n[3]
 */
      __pyx_t_119 = 1;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_par]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_120 = 1;
      __pyx_t_121 = (__pyx_v_last_index - 1);
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_120 * __pyx_t_13.strides[0]) )) + __pyx_t_121)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_119)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2771
 *                 v_U[par].u[0, last_index - 1] = x_n[0]
 *                 v_U[par].u[1, last_index - 1] = x_n[1]
 *                 v_U[d1].u[0, 0] = x_n[2]             # <<<<<<<<<<<<<<
 *                 v_U[d1].u[1, 0] = x_n[3]
 *                 v_U[d2].u[0, 0] = x_n[4]
 */
      __pyx_t_122 = 2;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_123 = 0;
      __pyx_t_124 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_123 * __pyx_t_13.strides[0]) )) + __pyx_t_124)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_122)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2772
 *                 v_U[par].u[1, last_index - 1] = x_n[1]
 *                 v_U[d1].u[0, 0] = x_n[2]
 *                 v_U[d1].u[1, 0] = x_n[3]             # <<<<<<<<<<<<<<
 *                 v_U[d2].u[0, 0] = x_n[4]
 *                 v_U[d2].u[1, 0] = x_n[5]
 */
      __pyx_t_125 = 3;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_126 = 1;
      __pyx_t_127 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_126 * __pyx_t_13.strides[0]) )) + __pyx_t_127)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_125)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2773
 *                 v_U[d1].u[0, 0] = x_n[2]
 *                 v_U[d1].u[1, 0] = x_n[3]
 *                 v_U[d2].u[0, 0] = x_n[4]             # <<<<<<<<<<<<<<
 *                 v_U[d2].u[1, 0] = x_n[5]
 * 
 */
      __pyx_t_128 = 4;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_129 = 0;
      __pyx_t_130 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_129 * __pyx_t_13.strides[0]) )) + __pyx_t_130)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_128)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2774
 *                 v_U[d1].u[1, 0] = x_n[3]
 *                 v_U[d2].u[0, 0] = x_n[4]
 *                 v_U[d2].u[1, 0] = x_n[5]             # <<<<<<<<<<<<<<
 * 
 *             for index in range(siz_UConj):
 */
      __pyx_t_131 = 5;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_132 = 1;
      __pyx_t_133 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_132 * __pyx_t_13.strides[0]) )) + __pyx_t_133)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n.data) + __pyx_t_131)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
    }

    /* "pylsewave/cynum.pyx":2776
 *                 v_U[d2].u[1, 0] = x_n[5]
 * 
 *             for index in range(siz_UConj):             # <<<<<<<<<<<<<<
 *                 d1 = self.UConj_arr[index, 0]
 *                 d2 = self.UConj_arr[index, 1]
 */
    __pyx_t_47 = __pyx_v_siz_UConj;
    for (__pyx_t_44 = 0; __pyx_t_44 < __pyx_t_47; __pyx_t_44+=1) {
      __pyx_v_index = __pyx_t_44;

      /* "pylsewave/cynum.pyx":2777
 * 
 *             for index in range(siz_UConj):
 *                 d1 = self.UConj_arr[index, 0]             # <<<<<<<<<<<<<<
 *                 d2 = self.UConj_arr[index, 1]
 *                 conj_list[0] = d1
 */
      __pyx_t_134 = __pyx_v_index;
      __pyx_t_135 = 0;
      __pyx_v_d1 = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->__pyx_base.__pyx_base.UConj_arr.data + __pyx_t_134 * __pyx_v_self->__pyx_base.__pyx_base.UConj_arr.strides[0]) )) + __pyx_t_135)) )));

      /* "pylsewave/cynum.pyx":2778
 *             for index in range(siz_UConj):
 *                 d1 = self.UConj_arr[index, 0]
 *                 d2 = self.UConj_arr[index, 1]             # <<<<<<<<<<<<<<
 *                 conj_list[0] = d1
 *                 conj_list[1] = d2
 */
      __pyx_t_136 = __pyx_v_index;
      __pyx_t_137 = 1;
      __pyx_v_d2 = (*((int *) ( /* dim=1 */ ((char *) (((int *) ( /* dim=0 */ (__pyx_v_self->__pyx_base.__pyx_base.UConj_arr.data + __pyx_t_136 * __pyx_v_self->__pyx_base.__pyx_base.UConj_arr.strides[0]) )) + __pyx_t_137)) )));

      /* "pylsewave/cynum.pyx":2779
 *                 d1 = self.UConj_arr[index, 0]
 *                 d2 = self.UConj_arr[index, 1]
 *                 conj_list[0] = d1             # <<<<<<<<<<<<<<
 *                 conj_list[1] = d2
 *                 u_nmp1_conj[0], u_nmp1_conj[1], u_nmp1_conj[2], u_nmp1_conj[3] = 0.0, 0.0, 0.0, 0.0
 */
      __pyx_t_138 = 0;
      *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_conj_list.data) + __pyx_t_138)) )) = __pyx_v_d1;

      /* "pylsewave/cynum.pyx":2780
 *                 d2 = self.UConj_arr[index, 1]
 *                 conj_list[0] = d1
 *                 conj_list[1] = d2             # <<<<<<<<<<<<<<
 *                 u_nmp1_conj[0], u_nmp1_conj[1], u_nmp1_conj[2], u_nmp1_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 x_n_conj[0], x_n_conj[1], x_n_conj[2], x_n_conj[3] = 0.0, 0.0, 0.0, 0.0
 */
      __pyx_t_139 = 1;
      *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_conj_list.data) + __pyx_t_139)) )) = __pyx_v_d2;

      /* "pylsewave/cynum.pyx":2781
 *                 conj_list[0] = d1
 *                 conj_list[1] = d2
 *                 u_nmp1_conj[0], u_nmp1_conj[1], u_nmp1_conj[2], u_nmp1_conj[3] = 0.0, 0.0, 0.0, 0.0             # <<<<<<<<<<<<<<
 *                 x_n_conj[0], x_n_conj[1], x_n_conj[2], x_n_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[d1].u.shape[1]
 */
      __pyx_t_16 = 0.0;
      __pyx_t_62 = 0.0;
      __pyx_t_63 = 0.0;
      __pyx_t_64 = 0.0;
      __pyx_t_140 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_140)) )) = __pyx_t_16;
      __pyx_t_141 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_141)) )) = __pyx_t_62;
      __pyx_t_142 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_142)) )) = __pyx_t_63;
      __pyx_t_143 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_143)) )) = __pyx_t_64;

      /* "pylsewave/cynum.pyx":2782
 *                 conj_list[1] = d2
 *                 u_nmp1_conj[0], u_nmp1_conj[1], u_nmp1_conj[2], u_nmp1_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 x_n_conj[0], x_n_conj[1], x_n_conj[2], x_n_conj[3] = 0.0, 0.0, 0.0, 0.0             # <<<<<<<<<<<<<<
 *                 last_index = v_U[d1].u.shape[1]
 *                 first_index = 0
 */
      __pyx_t_64 = 0.0;
      __pyx_t_63 = 0.0;
      __pyx_t_62 = 0.0;
      __pyx_t_16 = 0.0;
      __pyx_t_144 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_144)) )) = __pyx_t_64;
      __pyx_t_145 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_145)) )) = __pyx_t_63;
      __pyx_t_146 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_146)) )) = __pyx_t_62;
      __pyx_t_147 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_147)) )) = __pyx_t_16;

      /* "pylsewave/cynum.pyx":2783
 *                 u_nmp1_conj[0], u_nmp1_conj[1], u_nmp1_conj[2], u_nmp1_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 x_n_conj[0], x_n_conj[1], x_n_conj[2], x_n_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[d1].u.shape[1]             # <<<<<<<<<<<<<<
 *                 first_index = 0
 *                 u_nmp1_conj[0] = v_U[d1].u[0, last_index - 2]
 */
      __pyx_v_last_index = ((__pyx_v_v_U[__pyx_v_d1]).u.shape[1]);

      /* "pylsewave/cynum.pyx":2784
 *                 x_n_conj[0], x_n_conj[1], x_n_conj[2], x_n_conj[3] = 0.0, 0.0, 0.0, 0.0
 *                 last_index = v_U[d1].u.shape[1]
 *                 first_index = 0             # <<<<<<<<<<<<<<
 *                 u_nmp1_conj[0] = v_U[d1].u[0, last_index - 2]
 *                 u_nmp1_conj[1] = v_U[d1].u[1, last_index - 2]
 */
      __pyx_v_first_index = 0;

      /* "pylsewave/cynum.pyx":2785
 *                 last_index = v_U[d1].u.shape[1]
 *                 first_index = 0
 *                 u_nmp1_conj[0] = v_U[d1].u[0, last_index - 2]             # <<<<<<<<<<<<<<
 *                 u_nmp1_conj[1] = v_U[d1].u[1, last_index - 2]
 *                 x_n_conj[0] = v_U[d1].u_n[0, last_index - 1]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_148 = 0;
      __pyx_t_149 = (__pyx_v_last_index - 2);
      __pyx_t_150 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_150)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_148 * __pyx_t_13.strides[0]) )) + __pyx_t_149)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2786
 *                 first_index = 0
 *                 u_nmp1_conj[0] = v_U[d1].u[0, last_index - 2]
 *                 u_nmp1_conj[1] = v_U[d1].u[1, last_index - 2]             # <<<<<<<<<<<<<<
 *                 x_n_conj[0] = v_U[d1].u_n[0, last_index - 1]
 *                 x_n_conj[1] = v_U[d1].u_n[1, last_index - 1]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_151 = 1;
      __pyx_t_152 = (__pyx_v_last_index - 2);
      __pyx_t_153 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_153)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_151 * __pyx_t_13.strides[0]) )) + __pyx_t_152)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2787
 *                 u_nmp1_conj[0] = v_U[d1].u[0, last_index - 2]
 *                 u_nmp1_conj[1] = v_U[d1].u[1, last_index - 2]
 *                 x_n_conj[0] = v_U[d1].u_n[0, last_index - 1]             # <<<<<<<<<<<<<<
 *                 x_n_conj[1] = v_U[d1].u_n[1, last_index - 1]
 *                 u_nmp1_conj[2] = v_U[d2].u[0, first_index + 1]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_154 = 0;
      __pyx_t_155 = (__pyx_v_last_index - 1);
      __pyx_t_156 = 0;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_156)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_154 * __pyx_t_13.strides[0]) )) + __pyx_t_155)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2788
 *                 u_nmp1_conj[1] = v_U[d1].u[1, last_index - 2]
 *                 x_n_conj[0] = v_U[d1].u_n[0, last_index - 1]
 *                 x_n_conj[1] = v_U[d1].u_n[1, last_index - 1]             # <<<<<<<<<<<<<<
 *                 u_nmp1_conj[2] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1_conj[3] = v_U[d2].u[1, first_index + 1]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_157 = 1;
      __pyx_t_158 = (__pyx_v_last_index - 1);
      __pyx_t_159 = 1;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_159)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_157 * __pyx_t_13.strides[0]) )) + __pyx_t_158)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2789
 *                 x_n_conj[0] = v_U[d1].u_n[0, last_index - 1]
 *                 x_n_conj[1] = v_U[d1].u_n[1, last_index - 1]
 *                 u_nmp1_conj[2] = v_U[d2].u[0, first_index + 1]             # <<<<<<<<<<<<<<
 *                 u_nmp1_conj[3] = v_U[d2].u[1, first_index + 1]
 *                 x_n_conj[2] = v_U[d2].u_n[0, first_index]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_160 = 0;
      __pyx_t_161 = (__pyx_v_first_index + 1);
      __pyx_t_162 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_162)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_160 * __pyx_t_13.strides[0]) )) + __pyx_t_161)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2790
 *                 x_n_conj[1] = v_U[d1].u_n[1, last_index - 1]
 *                 u_nmp1_conj[2] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1_conj[3] = v_U[d2].u[1, first_index + 1]             # <<<<<<<<<<<<<<
 *                 x_n_conj[2] = v_U[d2].u_n[0, first_index]
 *                 x_n_conj[3] = v_U[d2].u_n[1, first_index]
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_163 = 1;
      __pyx_t_164 = (__pyx_v_first_index + 1);
      __pyx_t_165 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_u_nmp1_conj.data) + __pyx_t_165)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_163 * __pyx_t_13.strides[0]) )) + __pyx_t_164)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2791
 *                 u_nmp1_conj[2] = v_U[d2].u[0, first_index + 1]
 *                 u_nmp1_conj[3] = v_U[d2].u[1, first_index + 1]
 *                 x_n_conj[2] = v_U[d2].u_n[0, first_index]             # <<<<<<<<<<<<<<
 *                 x_n_conj[3] = v_U[d2].u_n[1, first_index]
 * 
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_166 = 0;
      __pyx_t_167 = __pyx_v_first_index;
      __pyx_t_168 = 2;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_168)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_166 * __pyx_t_13.strides[0]) )) + __pyx_t_167)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2792
 *                 u_nmp1_conj[3] = v_U[d2].u[1, first_index + 1]
 *                 x_n_conj[2] = v_U[d2].u_n[0, first_index]
 *                 x_n_conj[3] = v_U[d2].u_n[1, first_index]             # <<<<<<<<<<<<<<
 * 
 *                 iter_count = Newton_Raphson_Sys_conj(self._bcs, x_n_conj, u_nmp1_conj, self._dt,
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u_n;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_169 = 1;
      __pyx_t_170 = __pyx_v_first_index;
      __pyx_t_171 = 3;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_171)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_169 * __pyx_t_13.strides[0]) )) + __pyx_t_170)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2794
 *                 x_n_conj[3] = v_U[d2].u_n[1, first_index]
 * 
 *                 iter_count = Newton_Raphson_Sys_conj(self._bcs, x_n_conj, u_nmp1_conj, self._dt,             # <<<<<<<<<<<<<<
 *                                                      conj_list, 1.0e-9, 100)
 * 
 */
      __pyx_t_37 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._bcs);
      __Pyx_INCREF(__pyx_t_37);

      /* "pylsewave/cynum.pyx":2795
 * 
 *                 iter_count = Newton_Raphson_Sys_conj(self._bcs, x_n_conj, u_nmp1_conj, self._dt,
 *                                                      conj_list, 1.0e-9, 100)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_172.__pyx_n = 1;
      __pyx_t_172.N = 0x64;
      __pyx_t_43 = __pyx_f_9pylsewave_5cynum_Newton_Raphson_Sys_conj(((struct __pyx_obj_9pylsewave_5cynum_cBCs *)__pyx_t_37), __pyx_v_x_n_conj, __pyx_v_u_nmp1_conj, __pyx_v_self->__pyx_base.__pyx_base._dt, __pyx_v_conj_list, 1.0e-9, &__pyx_t_172); 
      __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
      __pyx_v_iter_count = __pyx_t_43;

      /* "pylsewave/cynum.pyx":2798
 * 
 * 
 *                 v_U[d1].u[0, last_index - 1] = x_n_conj[0]             # <<<<<<<<<<<<<<
 *                 v_U[d1].u[1, last_index - 1] = x_n_conj[1]
 *                 v_U[d2].u[0, 0] = x_n_conj[2]
 */
      __pyx_t_173 = 0;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_174 = 0;
      __pyx_t_175 = (__pyx_v_last_index - 1);
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_174 * __pyx_t_13.strides[0]) )) + __pyx_t_175)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_173)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2799
 * 
 *                 v_U[d1].u[0, last_index - 1] = x_n_conj[0]
 *                 v_U[d1].u[1, last_index - 1] = x_n_conj[1]             # <<<<<<<<<<<<<<
 *                 v_U[d2].u[0, 0] = x_n_conj[2]
 *                 v_U[d2].u[1, 0] = x_n_conj[3]
 */
      __pyx_t_176 = 1;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d1]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_177 = 1;
      __pyx_t_178 = (__pyx_v_last_index - 1);
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_177 * __pyx_t_13.strides[0]) )) + __pyx_t_178)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_176)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2800
 *                 v_U[d1].u[0, last_index - 1] = x_n_conj[0]
 *                 v_U[d1].u[1, last_index - 1] = x_n_conj[1]
 *                 v_U[d2].u[0, 0] = x_n_conj[2]             # <<<<<<<<<<<<<<
 *                 v_U[d2].u[1, 0] = x_n_conj[3]
 * 
 */
      __pyx_t_179 = 2;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_180 = 0;
      __pyx_t_181 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_180 * __pyx_t_13.strides[0]) )) + __pyx_t_181)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_179)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2801
 *                 v_U[d1].u[1, last_index - 1] = x_n_conj[1]
 *                 v_U[d2].u[0, 0] = x_n_conj[2]
 *                 v_U[d2].u[1, 0] = x_n_conj[3]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_182 = 3;
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_d2]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      __pyx_t_183 = 1;
      __pyx_t_184 = 0;
      *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_183 * __pyx_t_13.strides[0]) )) + __pyx_t_184)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_n_conj.data) + __pyx_t_182)) )));
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
    }

    /* "pylsewave/cynum.pyx":2804
 * 
 * 
 *             for i in range(length):             # <<<<<<<<<<<<<<
 *                 parU[i].x_hyper[:, :] = v_U[i].u
 *                 self._advance_Godunov_splitting(parU[i], v_U[i].u, n, self._dt, self.mesh.vessels[i].dx, i, 1.0)
 */
    __pyx_t_15 = __pyx_v_length;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_15; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "pylsewave/cynum.pyx":2805
 * 
 *             for i in range(length):
 *                 parU[i].x_hyper[:, :] = v_U[i].u             # <<<<<<<<<<<<<<
 *                 self._advance_Godunov_splitting(parU[i], v_U[i].u, n, self._dt, self.mesh.vessels[i].dx, i, 1.0)
 *                 if (user_action is not None) and (n % user_action.skip_frame == 0):
 */
      __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u;
      __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
      if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_13, (__pyx_v_parU[__pyx_v_i]).x_hyper, 2, 2, 0) < 0)) __PYX_ERR(0, 2805, __pyx_L1_error)
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

      /* "pylsewave/cynum.pyx":2806
 *             for i in range(length):
 *                 parU[i].x_hyper[:, :] = v_U[i].u
 *                 self._advance_Godunov_splitting(parU[i], v_U[i].u, n, self._dt, self.mesh.vessels[i].dx, i, 1.0)             # <<<<<<<<<<<<<<
 *                 if (user_action is not None) and (n % user_action.skip_frame == 0):
 *                     # # check cfl condition
 */
      __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2806, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_37);
      __pyx_t_38 = __Pyx_GetItemInt(__pyx_t_37, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2806, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_38);
      __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
      __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_dx); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2806, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_37);
      __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
      __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_37); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2806, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
      ((struct __pyx_vtabstruct_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_advance_Godunov_splitting(__pyx_v_self, (__pyx_v_parU[__pyx_v_i]), (__pyx_v_v_U[__pyx_v_i]).u, __pyx_v_n, __pyx_v_self->__pyx_base.__pyx_base._dt, __pyx_t_16, __pyx_v_i, 1.0, 0);

      /* "pylsewave/cynum.pyx":2807
 *                 parU[i].x_hyper[:, :] = v_U[i].u
 *                 self._advance_Godunov_splitting(parU[i], v_U[i].u, n, self._dt, self.mesh.vessels[i].dx, i, 1.0)
 *                 if (user_action is not None) and (n % user_action.skip_frame == 0):             # <<<<<<<<<<<<<<
 *                     # # check cfl condition
 *                     res_cfl = self.cfl_condition(parU[i].x_hyper, v_U[i].dx, self._dt, i)
 */
      __pyx_t_24 = (__pyx_v_user_action != Py_None);
      __pyx_t_185 = (__pyx_t_24 != 0);
      if (__pyx_t_185) {
      } else {
        __pyx_t_23 = __pyx_t_185;
        goto __pyx_L45_bool_binop_done;
      }
      __pyx_t_37 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2807, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_37);
      __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_v_user_action, __pyx_n_s_skip_frame); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2807, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_38);
      __pyx_t_3 = PyNumber_Remainder(__pyx_t_37, __pyx_t_38); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2807, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_37); __pyx_t_37 = 0;
      __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
      __pyx_t_38 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2807, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_38);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_185 = __Pyx_PyObject_IsTrue(__pyx_t_38); if (unlikely(__pyx_t_185 < 0)) __PYX_ERR(0, 2807, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
      __pyx_t_23 = __pyx_t_185;
      __pyx_L45_bool_binop_done:;
      if (__pyx_t_23) {

        /* "pylsewave/cynum.pyx":2809
 *                 if (user_action is not None) and (n % user_action.skip_frame == 0):
 *                     # # check cfl condition
 *                     res_cfl = self.cfl_condition(parU[i].x_hyper, v_U[i].dx, self._dt, i)             # <<<<<<<<<<<<<<
 *                     if res_cfl == CFL.CFL_STATUS_ERROR:
 *                         print("Solver failed in vessel %d in time increment %d  spatial %d and lenght=%d" % (i, n, j, v_U[i].x_size))
 */
        __pyx_v_res_cfl = ((struct __pyx_vtabstruct_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.cfl_condition(((struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self), (__pyx_v_parU[__pyx_v_i]).x_hyper, (__pyx_v_v_U[__pyx_v_i]).dx, __pyx_v_self->__pyx_base.__pyx_base._dt, __pyx_v_i);

        /* "pylsewave/cynum.pyx":2810
 *                     # # check cfl condition
 *                     res_cfl = self.cfl_condition(parU[i].x_hyper, v_U[i].dx, self._dt, i)
 *                     if res_cfl == CFL.CFL_STATUS_ERROR:             # <<<<<<<<<<<<<<
 *                         print("Solver failed in vessel %d in time increment %d  spatial %d and lenght=%d" % (i, n, j, v_U[i].x_size))
 *                         return SOLVER.SOLVER_STATUS_ERROR
 */
        __pyx_t_23 = ((__pyx_v_res_cfl == __pyx_e_9pylsewave_5cynum_CFL_STATUS_ERROR) != 0);
        if (__pyx_t_23) {

          /* "pylsewave/cynum.pyx":2811
 *                     res_cfl = self.cfl_condition(parU[i].x_hyper, v_U[i].dx, self._dt, i)
 *                     if res_cfl == CFL.CFL_STATUS_ERROR:
 *                         print("Solver failed in vessel %d in time increment %d  spatial %d and lenght=%d" % (i, n, j, v_U[i].x_size))             # <<<<<<<<<<<<<<
 *                         return SOLVER.SOLVER_STATUS_ERROR
 *                     else:
 */
          __pyx_t_38 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2811, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_38);
          __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2811, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_37 = PyInt_FromSsize_t(__pyx_v_j); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2811, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_37);
          __pyx_t_41 = PyInt_FromSsize_t((__pyx_v_v_U[__pyx_v_i]).x_size); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2811, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_41);
          __pyx_t_39 = PyTuple_New(4); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2811, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_39);
          __Pyx_GIVEREF(__pyx_t_38);
          PyTuple_SET_ITEM(__pyx_t_39, 0, __pyx_t_38);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_39, 1, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_37);
          PyTuple_SET_ITEM(__pyx_t_39, 2, __pyx_t_37);
          __Pyx_GIVEREF(__pyx_t_41);
          PyTuple_SET_ITEM(__pyx_t_39, 3, __pyx_t_41);
          __pyx_t_38 = 0;
          __pyx_t_3 = 0;
          __pyx_t_37 = 0;
          __pyx_t_41 = 0;
          __pyx_t_41 = __Pyx_PyString_Format(__pyx_kp_s_Solver_failed_in_vessel_d_in_tim, __pyx_t_39); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2811, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_41);
          __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
          if (__Pyx_PrintOne(0, __pyx_t_41) < 0) __PYX_ERR(0, 2811, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;

          /* "pylsewave/cynum.pyx":2812
 *                     if res_cfl == CFL.CFL_STATUS_ERROR:
 *                         print("Solver failed in vessel %d in time increment %d  spatial %d and lenght=%d" % (i, n, j, v_U[i].x_size))
 *                         return SOLVER.SOLVER_STATUS_ERROR             # <<<<<<<<<<<<<<
 *                     else:
 * 
 */
          __pyx_r = __pyx_e_9pylsewave_5cynum_SOLVER_STATUS_ERROR;
          goto __pyx_L0;

          /* "pylsewave/cynum.pyx":2810
 *                     # # check cfl condition
 *                     res_cfl = self.cfl_condition(parU[i].x_hyper, v_U[i].dx, self._dt, i)
 *                     if res_cfl == CFL.CFL_STATUS_ERROR:             # <<<<<<<<<<<<<<
 *                         print("Solver failed in vessel %d in time increment %d  spatial %d and lenght=%d" % (i, n, j, v_U[i].x_size))
 *                         return SOLVER.SOLVER_STATUS_ERROR
 */
        }

        /* "pylsewave/cynum.pyx":2815
 *                     else:
 * 
 *                         self._pdes.pressure_visco(v_U[i].u, i, v_U[i].u_store[2, :])             # <<<<<<<<<<<<<<
 * 
 *                         v_U[i].u_store[0, :] = v_U[i].u[0, :]
 */
        /*else*/ {
          __pyx_t_39 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._pdes), __pyx_n_s_pressure_visco); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2815, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_39);
          __pyx_t_37 = __pyx_memoryview_fromslice((__pyx_v_v_U[__pyx_v_i]).u, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2815, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_37);
          __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2815, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u_store;
          __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
          __pyx_t_8.data = __pyx_t_13.data;
          __pyx_t_8.memview = __pyx_t_13.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
          {
    Py_ssize_t __pyx_tmp_idx = 2;
    Py_ssize_t __pyx_tmp_shape = __pyx_t_13.shape[0];
    Py_ssize_t __pyx_tmp_stride = __pyx_t_13.strides[0];
    if (0 && (__pyx_tmp_idx < 0))
        __pyx_tmp_idx += __pyx_tmp_shape;
    if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
        PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
        __PYX_ERR(0, 2815, __pyx_L1_error)
    }
        __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_8.shape[0] = __pyx_t_13.shape[1];
__pyx_t_8.strides[0] = __pyx_t_13.strides[1];
    __pyx_t_8.suboffsets[0] = -1;

__PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
          __pyx_t_38 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2815, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_38);
          __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
          __pyx_t_4 = NULL;
          __pyx_t_12 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_39))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_39);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_39);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_39, function);
              __pyx_t_12 = 1;
            }
          }
          __pyx_t_6 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2815, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_37);
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_12, __pyx_t_37);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_12, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_38);
          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_12, __pyx_t_38);
          __pyx_t_37 = 0;
          __pyx_t_3 = 0;
          __pyx_t_38 = 0;
          __pyx_t_41 = __Pyx_PyObject_Call(__pyx_t_39, __pyx_t_6, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2815, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_41);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
          __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;

          /* "pylsewave/cynum.pyx":2817
 *                         self._pdes.pressure_visco(v_U[i].u, i, v_U[i].u_store[2, :])
 * 
 *                         v_U[i].u_store[0, :] = v_U[i].u[0, :]             # <<<<<<<<<<<<<<
 *                         v_U[i].u_store[1, :] = v_U[i].u[1, :]
 *                         # v_U[i].u_store[2, j] = p
 */
          __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u;
          __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
          __pyx_t_8.data = __pyx_t_13.data;
          __pyx_t_8.memview = __pyx_t_13.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
          {
    Py_ssize_t __pyx_tmp_idx = 0;
    Py_ssize_t __pyx_tmp_shape = __pyx_t_13.shape[0];
    Py_ssize_t __pyx_tmp_stride = __pyx_t_13.strides[0];
    if (0 && (__pyx_tmp_idx < 0))
        __pyx_tmp_idx += __pyx_tmp_shape;
    if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
        PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
        __PYX_ERR(0, 2817, __pyx_L1_error)
    }
        __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_8.shape[0] = __pyx_t_13.shape[1];
__pyx_t_8.strides[0] = __pyx_t_13.strides[1];
    __pyx_t_8.suboffsets[0] = -1;

__PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
          __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u_store;
          __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
          __pyx_t_186.data = __pyx_t_13.data;
          __pyx_t_186.memview = __pyx_t_13.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_186, 0);
          {
    Py_ssize_t __pyx_tmp_idx = 0;
    Py_ssize_t __pyx_tmp_shape = __pyx_t_13.shape[0];
    Py_ssize_t __pyx_tmp_stride = __pyx_t_13.strides[0];
    if (0 && (__pyx_tmp_idx < 0))
        __pyx_tmp_idx += __pyx_tmp_shape;
    if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
        PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
        __PYX_ERR(0, 2817, __pyx_L1_error)
    }
        __pyx_t_186.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_186.shape[0] = __pyx_t_13.shape[1];
__pyx_t_186.strides[0] = __pyx_t_13.strides[1];
    __pyx_t_186.suboffsets[0] = -1;

__PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
          if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_8, __pyx_t_186, 1, 1, 0) < 0)) __PYX_ERR(0, 2817, __pyx_L1_error)
          __PYX_XDEC_MEMVIEW(&__pyx_t_186, 1);
          __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);

          /* "pylsewave/cynum.pyx":2818
 * 
 *                         v_U[i].u_store[0, :] = v_U[i].u[0, :]
 *                         v_U[i].u_store[1, :] = v_U[i].u[1, :]             # <<<<<<<<<<<<<<
 *                         # v_U[i].u_store[2, j] = p
 * 
 */
          __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u;
          __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
          __pyx_t_8.data = __pyx_t_13.data;
          __pyx_t_8.memview = __pyx_t_13.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
          {
    Py_ssize_t __pyx_tmp_idx = 1;
    Py_ssize_t __pyx_tmp_shape = __pyx_t_13.shape[0];
    Py_ssize_t __pyx_tmp_stride = __pyx_t_13.strides[0];
    if (0 && (__pyx_tmp_idx < 0))
        __pyx_tmp_idx += __pyx_tmp_shape;
    if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
        PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
        __PYX_ERR(0, 2818, __pyx_L1_error)
    }
        __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_8.shape[0] = __pyx_t_13.shape[1];
__pyx_t_8.strides[0] = __pyx_t_13.strides[1];
    __pyx_t_8.suboffsets[0] = -1;

__PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
          __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u_store;
          __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
          __pyx_t_187.data = __pyx_t_13.data;
          __pyx_t_187.memview = __pyx_t_13.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_187, 0);
          {
    Py_ssize_t __pyx_tmp_idx = 1;
    Py_ssize_t __pyx_tmp_shape = __pyx_t_13.shape[0];
    Py_ssize_t __pyx_tmp_stride = __pyx_t_13.strides[0];
    if (0 && (__pyx_tmp_idx < 0))
        __pyx_tmp_idx += __pyx_tmp_shape;
    if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
        PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
        __PYX_ERR(0, 2818, __pyx_L1_error)
    }
        __pyx_t_187.data += __pyx_tmp_idx * __pyx_tmp_stride;
}

__pyx_t_187.shape[0] = __pyx_t_13.shape[1];
__pyx_t_187.strides[0] = __pyx_t_13.strides[1];
    __pyx_t_187.suboffsets[0] = -1;

__PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
          if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_8, __pyx_t_187, 1, 1, 0) < 0)) __PYX_ERR(0, 2818, __pyx_L1_error)
          __PYX_XDEC_MEMVIEW(&__pyx_t_187, 1);
          __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);

          /* "pylsewave/cynum.pyx":2821
 *                         # v_U[i].u_store[2, j] = p
 * 
 *                         user_action(v_U[i].u_store, self.mesh.vessels[i].x, self._t, n, PRINT_STATUS, WRITE_STATUS, i)             # <<<<<<<<<<<<<<
 *                     # cwrite2file("./run_cases/.tmpdata__u_%010d__vessel_%03d.dat" % (n, i), v_U[i].u_store)
 * 
 */
          __pyx_t_39 = __pyx_memoryview_fromslice((__pyx_v_v_U[__pyx_v_i]).u_store, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 2821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_39);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.mesh, __pyx_n_s_vessels); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_38 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_38);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_38, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_38); __pyx_t_38 = 0;
          __pyx_t_38 = __pyx_memoryview_fromslice(__pyx_v_self->__pyx_base.__pyx_base._t, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 2821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_38);
          __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_37 = __Pyx_GetModuleGlobalName(__pyx_n_s_PRINT_STATUS); if (unlikely(!__pyx_t_37)) __PYX_ERR(0, 2821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_37);
          __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_WRITE_STATUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_user_action);
          __pyx_t_2 = __pyx_v_user_action; __pyx_t_40 = NULL;
          __pyx_t_12 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_40 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_40)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_40);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_12 = 1;
            }
          }
          __pyx_t_188 = PyTuple_New(7+__pyx_t_12); if (unlikely(!__pyx_t_188)) __PYX_ERR(0, 2821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_188);
          if (__pyx_t_40) {
            __Pyx_GIVEREF(__pyx_t_40); PyTuple_SET_ITEM(__pyx_t_188, 0, __pyx_t_40); __pyx_t_40 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_39);
          PyTuple_SET_ITEM(__pyx_t_188, 0+__pyx_t_12, __pyx_t_39);
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_188, 1+__pyx_t_12, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_38);
          PyTuple_SET_ITEM(__pyx_t_188, 2+__pyx_t_12, __pyx_t_38);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_188, 3+__pyx_t_12, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_37);
          PyTuple_SET_ITEM(__pyx_t_188, 4+__pyx_t_12, __pyx_t_37);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_188, 5+__pyx_t_12, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_188, 6+__pyx_t_12, __pyx_t_1);
          __pyx_t_39 = 0;
          __pyx_t_6 = 0;
          __pyx_t_38 = 0;
          __pyx_t_3 = 0;
          __pyx_t_37 = 0;
          __pyx_t_4 = 0;
          __pyx_t_1 = 0;
          __pyx_t_41 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_188, NULL); if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 2821, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_41);
          __Pyx_DECREF(__pyx_t_188); __pyx_t_188 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
        }

        /* "pylsewave/cynum.pyx":2807
 *                 parU[i].x_hyper[:, :] = v_U[i].u
 *                 self._advance_Godunov_splitting(parU[i], v_U[i].u, n, self._dt, self.mesh.vessels[i].dx, i, 1.0)
 *                 if (user_action is not None) and (n % user_action.skip_frame == 0):             # <<<<<<<<<<<<<<
 *                     # # check cfl condition
 *                     res_cfl = self.cfl_condition(parU[i].x_hyper, v_U[i].dx, self._dt, i)
 */
      }

      /* "pylsewave/cynum.pyx":2824
 *                     # cwrite2file("./run_cases/.tmpdata__u_%010d__vessel_%03d.dat" % (n, i), v_U[i].u_store)
 * 
 *                 for j in range(v_U[i].x_size):             # <<<<<<<<<<<<<<
 *                     v_U[i].u_n[0, j] = v_U[i].u[0, j]
 *                     v_U[i].u_n[1, j] = v_U[i].u[1, j]
 */
      __pyx_t_12 = (__pyx_v_v_U[__pyx_v_i]).x_size;
      for (__pyx_t_189 = 0; __pyx_t_189 < __pyx_t_12; __pyx_t_189+=1) {
        __pyx_v_j = __pyx_t_189;

        /* "pylsewave/cynum.pyx":2825
 * 
 *                 for j in range(v_U[i].x_size):
 *                     v_U[i].u_n[0, j] = v_U[i].u[0, j]             # <<<<<<<<<<<<<<
 *                     v_U[i].u_n[1, j] = v_U[i].u[1, j]
 * 
 */
        __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u;
        __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
        __pyx_t_190 = 0;
        __pyx_t_191 = __pyx_v_j;
        __pyx_t_28 = (__pyx_v_v_U[__pyx_v_i]).u_n;
        __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
        __pyx_t_192 = 0;
        __pyx_t_193 = __pyx_v_j;
        *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_28.data + __pyx_t_192 * __pyx_t_28.strides[0]) )) + __pyx_t_193)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_190 * __pyx_t_13.strides[0]) )) + __pyx_t_191)) )));
        __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
        __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);

        /* "pylsewave/cynum.pyx":2826
 *                 for j in range(v_U[i].x_size):
 *                     v_U[i].u_n[0, j] = v_U[i].u[0, j]
 *                     v_U[i].u_n[1, j] = v_U[i].u[1, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_13 = (__pyx_v_v_U[__pyx_v_i]).u;
        __PYX_INC_MEMVIEW(&__pyx_t_13, 1);
        __pyx_t_194 = 1;
        __pyx_t_195 = __pyx_v_j;
        __pyx_t_28 = (__pyx_v_v_U[__pyx_v_i]).u_n;
        __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
        __pyx_t_196 = 1;
        __pyx_t_197 = __pyx_v_j;
        *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_28.data + __pyx_t_196 * __pyx_t_28.strides[0]) )) + __pyx_t_197)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_t_13.data + __pyx_t_194 * __pyx_t_13.strides[0]) )) + __pyx_t_195)) )));
        __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
        __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
      }
    }

    /* "pylsewave/cynum.pyx":2829
 * 
 * 
 *             printf("\r%6.2f%%", (100.0 * self._t[n] / self._T))             # <<<<<<<<<<<<<<
 * 
 *         return SOLVER.SOLVER_STATUS_OK
 */
    __pyx_t_198 = __pyx_v_n;
    printf(((char const *)"\r%6.2f%%"), ((100.0 * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_self->__pyx_base.__pyx_base._t.data) + __pyx_t_198)) )))) / __pyx_v_self->__pyx_base.__pyx_base._T));
  }

  /* "pylsewave/cynum.pyx":2831
 *             printf("\r%6.2f%%", (100.0 * self._t[n] / self._T))
 * 
 *         return SOLVER.SOLVER_STATUS_OK             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __pyx_r = __pyx_e_9pylsewave_5cynum_SOLVER_STATUS_OK;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":2632
 *     @cython.initializedcheck(False)
 *     @cython.cdivision(True)
 *     cpdef SOLVER solve(self, user_action=None,             # <<<<<<<<<<<<<<
 *               version="vectorised"):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
  __Pyx_XDECREF(__pyx_t_37);
  __Pyx_XDECREF(__pyx_t_38);
  __Pyx_XDECREF(__pyx_t_39);
  __Pyx_XDECREF(__pyx_t_40);
  __Pyx_XDECREF(__pyx_t_41);
  __PYX_XDEC_MEMVIEW(&__pyx_t_186, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_187, 1);
  __Pyx_XDECREF(__pyx_t_188);
  __Pyx_WriteUnraisable("pylsewave.cynum.cMacCormackGodunovSplitSolver.solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = (enum __pyx_t_9pylsewave_5cynum_SOLVER) 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_getarr, 1);
  __Pyx_XDECREF(__pyx_v_time);
  __Pyx_XDECREF(__pyx_v_t0);
  __Pyx_XDECREF(__pyx_v_N_n);
  __PYX_XDEC_MEMVIEW(&__pyx_v_u_nmp1, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_x_n, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_u_nmp1_conj, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_x_n_conj, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_bif_list, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_conj_list, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_3solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_3solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_user_action = 0;
  PyObject *__pyx_v_version = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("solve (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_user_action,&__pyx_n_s_version,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)__pyx_n_s_vectorised);
    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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_user_action);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solve") < 0)) __PYX_ERR(0, 2632, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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;
      }
    }
    __pyx_v_user_action = values[0];
    __pyx_v_version = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("solve", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2632, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.cMacCormackGodunovSplitSolver.solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_2solve(((struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *)__pyx_v_self), __pyx_v_user_action, __pyx_v_version);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_2solve(struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *__pyx_v_self, PyObject *__pyx_v_user_action, PyObject *__pyx_v_version) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum __pyx_t_9pylsewave_5cynum_SOLVER __pyx_t_1;
  struct __pyx_opt_args_9pylsewave_5cynum_10cFDMSolver_solve __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("solve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.user_action = __pyx_v_user_action;
  __pyx_t_2.version = __pyx_v_version;
  __pyx_t_1 = __pyx_vtabptr_9pylsewave_5cynum_cMacCormackGodunovSplitSolver->__pyx_base.__pyx_base.solve(((struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)__pyx_v_self), 1, &__pyx_t_2); 
  __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_9pylsewave_5cynum_SOLVER(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pylsewave.cynum.cMacCormackGodunovSplitSolver.solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2834
 * 
 * @cython.boundscheck(False)
 * cpdef double norm2(double[::1] x):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t siz, i
 *     cdef double sums
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_9norm2(PyObject *__pyx_self, PyObject *__pyx_arg_x); /*proto*/
static double __pyx_f_9pylsewave_5cynum_norm2(__Pyx_memviewslice __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_siz;
  Py_ssize_t __pyx_v_i;
  double __pyx_v_sums;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("norm2", 0);

  /* "pylsewave/cynum.pyx":2837
 *     cdef Py_ssize_t siz, i
 *     cdef double sums
 *     sums = 0.             # <<<<<<<<<<<<<<
 *     siz = x.shape[0]
 *     for i in range(siz):
 */
  __pyx_v_sums = 0.;

  /* "pylsewave/cynum.pyx":2838
 *     cdef double sums
 *     sums = 0.
 *     siz = x.shape[0]             # <<<<<<<<<<<<<<
 *     for i in range(siz):
 *         sums = sums + x[i]*x[i]
 */
  __pyx_v_siz = (__pyx_v_x.shape[0]);

  /* "pylsewave/cynum.pyx":2839
 *     sums = 0.
 *     siz = x.shape[0]
 *     for i in range(siz):             # <<<<<<<<<<<<<<
 *         sums = sums + x[i]*x[i]
 *     return sqrt(sums)
 */
  __pyx_t_1 = __pyx_v_siz;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2840
 *     siz = x.shape[0]
 *     for i in range(siz):
 *         sums = sums + x[i]*x[i]             # <<<<<<<<<<<<<<
 *     return sqrt(sums)
 * 
 */
    __pyx_t_3 = __pyx_v_i;
    if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_x.shape[0];
    __pyx_t_4 = __pyx_v_i;
    if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_x.shape[0];
    __pyx_v_sums = (__pyx_v_sums + ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_3)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_4)) )))));
  }

  /* "pylsewave/cynum.pyx":2841
 *     for i in range(siz):
 *         sums = sums + x[i]*x[i]
 *     return sqrt(sums)             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __pyx_r = sqrt(__pyx_v_sums);
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":2834
 * 
 * @cython.boundscheck(False)
 * cpdef double norm2(double[::1] x):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t siz, i
 *     cdef double sums
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_9norm2(PyObject *__pyx_self, PyObject *__pyx_arg_x); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_9norm2(PyObject *__pyx_self, PyObject *__pyx_arg_x) {
  __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("norm2 (wrapper)", 0);
  assert(__pyx_arg_x); {
    __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_arg_x); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 2834, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.norm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_8norm2(__pyx_self, __pyx_v_x);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_8norm2(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("norm2", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_x.memview)) { __Pyx_RaiseUnboundLocalError("x"); __PYX_ERR(0, 2834, __pyx_L1_error) }
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_9pylsewave_5cynum_norm2(__pyx_v_x, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2834, __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("pylsewave.cynum.norm2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2844
 * 
 * @cython.boundscheck(False)
 * cpdef double dotVec(double[::1] a, double[::1] b):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t siz, i
 *     cdef double sums
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_11dotVec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_9pylsewave_5cynum_dotVec(__Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_siz;
  Py_ssize_t __pyx_v_i;
  double __pyx_v_sums;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("dotVec", 0);

  /* "pylsewave/cynum.pyx":2847
 *     cdef Py_ssize_t siz, i
 *     cdef double sums
 *     siz = a.shape[0]             # <<<<<<<<<<<<<<
 *     sums = 0
 *     for i in range(siz):
 */
  __pyx_v_siz = (__pyx_v_a.shape[0]);

  /* "pylsewave/cynum.pyx":2848
 *     cdef double sums
 *     siz = a.shape[0]
 *     sums = 0             # <<<<<<<<<<<<<<
 *     for i in range(siz):
 *         sums = sums + a[i]*b[i]
 */
  __pyx_v_sums = 0.0;

  /* "pylsewave/cynum.pyx":2849
 *     siz = a.shape[0]
 *     sums = 0
 *     for i in range(siz):             # <<<<<<<<<<<<<<
 *         sums = sums + a[i]*b[i]
 *     return sums
 */
  __pyx_t_1 = __pyx_v_siz;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2850
 *     sums = 0
 *     for i in range(siz):
 *         sums = sums + a[i]*b[i]             # <<<<<<<<<<<<<<
 *     return sums
 * 
 */
    __pyx_t_3 = __pyx_v_i;
    if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_a.shape[0];
    __pyx_t_4 = __pyx_v_i;
    if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_b.shape[0];
    __pyx_v_sums = (__pyx_v_sums + ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_a.data) + __pyx_t_3)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_4)) )))));
  }

  /* "pylsewave/cynum.pyx":2851
 *     for i in range(siz):
 *         sums = sums + a[i]*b[i]
 *     return sums             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __pyx_r = __pyx_v_sums;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":2844
 * 
 * @cython.boundscheck(False)
 * cpdef double dotVec(double[::1] a, double[::1] b):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t siz, i
 *     cdef double sums
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_11dotVec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_11dotVec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dotVec (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,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_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dotVec", 1, 2, 2, 1); __PYX_ERR(0, 2844, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dotVec") < 0)) __PYX_ERR(0, 2844, __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_a = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_a.memview)) __PYX_ERR(0, 2844, __pyx_L3_error)
    __pyx_v_b = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1]); if (unlikely(!__pyx_v_b.memview)) __PYX_ERR(0, 2844, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dotVec", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2844, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.dotVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_10dotVec(__pyx_self, __pyx_v_a, __pyx_v_b);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_10dotVec(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("dotVec", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); __PYX_ERR(0, 2844, __pyx_L1_error) }
  if (unlikely(!__pyx_v_b.memview)) { __Pyx_RaiseUnboundLocalError("b"); __PYX_ERR(0, 2844, __pyx_L1_error) }
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_9pylsewave_5cynum_dotVec(__pyx_v_a, __pyx_v_b, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2844, __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("pylsewave.cynum.dotVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2854
 * 
 * @cython.boundscheck(False)
 * cdef void swaprows(double[:, ::1] a, int i, int j):             # <<<<<<<<<<<<<<
 *     cdef int clms = a.shape[1]
 *     cdef int k
 */

static void __pyx_f_9pylsewave_5cynum_swaprows(__Pyx_memviewslice __pyx_v_a, int __pyx_v_i, int __pyx_v_j) {
  int __pyx_v_clms;
  int __pyx_v_k;
  double __pyx_v_temp;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  __Pyx_RefNannySetupContext("swaprows", 0);

  /* "pylsewave/cynum.pyx":2855
 * @cython.boundscheck(False)
 * cdef void swaprows(double[:, ::1] a, int i, int j):
 *     cdef int clms = a.shape[1]             # <<<<<<<<<<<<<<
 *     cdef int k
 *     cdef double temp
 */
  __pyx_v_clms = (__pyx_v_a.shape[1]);

  /* "pylsewave/cynum.pyx":2859
 *     cdef double temp
 * 
 *     for k in range(clms):             # <<<<<<<<<<<<<<
 *         temp = a[i, k]
 *         a[i, k] = a[j, k]
 */
  __pyx_t_1 = __pyx_v_clms;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_k = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2860
 * 
 *     for k in range(clms):
 *         temp = a[i, k]             # <<<<<<<<<<<<<<
 *         a[i, k] = a[j, k]
 *         a[j, k] = temp
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = __pyx_v_k;
    if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_a.shape[0];
    if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_a.shape[1];
    __pyx_v_temp = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_3 * __pyx_v_a.strides[0]) )) + __pyx_t_4)) )));

    /* "pylsewave/cynum.pyx":2861
 *     for k in range(clms):
 *         temp = a[i, k]
 *         a[i, k] = a[j, k]             # <<<<<<<<<<<<<<
 *         a[j, k] = temp
 * 
 */
    __pyx_t_5 = __pyx_v_j;
    __pyx_t_6 = __pyx_v_k;
    if (__pyx_t_5 < 0) __pyx_t_5 += __pyx_v_a.shape[0];
    if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_v_a.shape[1];
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_8 = __pyx_v_k;
    if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_a.shape[0];
    if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_a.shape[1];
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_7 * __pyx_v_a.strides[0]) )) + __pyx_t_8)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_5 * __pyx_v_a.strides[0]) )) + __pyx_t_6)) )));

    /* "pylsewave/cynum.pyx":2862
 *         temp = a[i, k]
 *         a[i, k] = a[j, k]
 *         a[j, k] = temp             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
    __pyx_t_9 = __pyx_v_j;
    __pyx_t_10 = __pyx_v_k;
    if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_a.shape[0];
    if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_a.shape[1];
    *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_9 * __pyx_v_a.strides[0]) )) + __pyx_t_10)) )) = __pyx_v_temp;
  }

  /* "pylsewave/cynum.pyx":2854
 * 
 * @cython.boundscheck(False)
 * cdef void swaprows(double[:, ::1] a, int i, int j):             # <<<<<<<<<<<<<<
 *     cdef int clms = a.shape[1]
 *     cdef int k
 */

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

/* "pylsewave/cynum.pyx":2865
 * 
 * @cython.boundscheck(False)
 * cdef void swaprowsVd(double[::1] a, int i, int j):             # <<<<<<<<<<<<<<
 *     cdef int clms = a.shape[0]
 *     cdef int k
 */

static void __pyx_f_9pylsewave_5cynum_swaprowsVd(__Pyx_memviewslice __pyx_v_a, int __pyx_v_i, int __pyx_v_j) {
  CYTHON_UNUSED int __pyx_v_clms;
  double __pyx_v_temp;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("swaprowsVd", 0);

  /* "pylsewave/cynum.pyx":2866
 * @cython.boundscheck(False)
 * cdef void swaprowsVd(double[::1] a, int i, int j):
 *     cdef int clms = a.shape[0]             # <<<<<<<<<<<<<<
 *     cdef int k
 *     cdef double temp
 */
  __pyx_v_clms = (__pyx_v_a.shape[0]);

  /* "pylsewave/cynum.pyx":2870
 *     cdef double temp
 * 
 *     temp = a[i]             # <<<<<<<<<<<<<<
 *     a[i] = a[j]
 *     a[j] = temp
 */
  __pyx_t_1 = __pyx_v_i;
  if (__pyx_t_1 < 0) __pyx_t_1 += __pyx_v_a.shape[0];
  __pyx_v_temp = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_a.data) + __pyx_t_1)) )));

  /* "pylsewave/cynum.pyx":2871
 * 
 *     temp = a[i]
 *     a[i] = a[j]             # <<<<<<<<<<<<<<
 *     a[j] = temp
 * 
 */
  __pyx_t_2 = __pyx_v_j;
  if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_a.shape[0];
  __pyx_t_3 = __pyx_v_i;
  if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_a.shape[0];
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_a.data) + __pyx_t_3)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_a.data) + __pyx_t_2)) )));

  /* "pylsewave/cynum.pyx":2872
 *     temp = a[i]
 *     a[i] = a[j]
 *     a[j] = temp             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __pyx_t_4 = __pyx_v_j;
  if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_a.shape[0];
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_a.data) + __pyx_t_4)) )) = __pyx_v_temp;

  /* "pylsewave/cynum.pyx":2865
 * 
 * @cython.boundscheck(False)
 * cdef void swaprowsVd(double[::1] a, int i, int j):             # <<<<<<<<<<<<<<
 *     cdef int clms = a.shape[0]
 *     cdef int k
 */

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

/* "pylsewave/cynum.pyx":2875
 * 
 * @cython.boundscheck(False)
 * cdef void swaprowsVi(int[::1] a, int i, int j):             # <<<<<<<<<<<<<<
 *     cdef int clms = a.shape[0]
 *     cdef int k
 */

static void __pyx_f_9pylsewave_5cynum_swaprowsVi(__Pyx_memviewslice __pyx_v_a, int __pyx_v_i, int __pyx_v_j) {
  CYTHON_UNUSED int __pyx_v_clms;
  int __pyx_v_temp;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("swaprowsVi", 0);

  /* "pylsewave/cynum.pyx":2876
 * @cython.boundscheck(False)
 * cdef void swaprowsVi(int[::1] a, int i, int j):
 *     cdef int clms = a.shape[0]             # <<<<<<<<<<<<<<
 *     cdef int k
 *     cdef int temp
 */
  __pyx_v_clms = (__pyx_v_a.shape[0]);

  /* "pylsewave/cynum.pyx":2880
 *     cdef int temp
 * 
 *     temp = a[i]             # <<<<<<<<<<<<<<
 *     a[i] = a[j]
 *     a[j] = temp
 */
  __pyx_t_1 = __pyx_v_i;
  if (__pyx_t_1 < 0) __pyx_t_1 += __pyx_v_a.shape[0];
  __pyx_v_temp = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_a.data) + __pyx_t_1)) )));

  /* "pylsewave/cynum.pyx":2881
 * 
 *     temp = a[i]
 *     a[i] = a[j]             # <<<<<<<<<<<<<<
 *     a[j] = temp
 * 
 */
  __pyx_t_2 = __pyx_v_j;
  if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_v_a.shape[0];
  __pyx_t_3 = __pyx_v_i;
  if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_a.shape[0];
  *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_a.data) + __pyx_t_3)) )) = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_a.data) + __pyx_t_2)) )));

  /* "pylsewave/cynum.pyx":2882
 *     temp = a[i]
 *     a[i] = a[j]
 *     a[j] = temp             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __pyx_t_4 = __pyx_v_j;
  if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_a.shape[0];
  *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_a.data) + __pyx_t_4)) )) = __pyx_v_temp;

  /* "pylsewave/cynum.pyx":2875
 * 
 * @cython.boundscheck(False)
 * cdef void swaprowsVi(int[::1] a, int i, int j):             # <<<<<<<<<<<<<<
 *     cdef int clms = a.shape[0]
 *     cdef int k
 */

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

/* "pylsewave/cynum.pyx":2886
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cdef int cLUdecomp(double[:,::1] a, int[::1] seq, double tol=1.0e-09):             # <<<<<<<<<<<<<<
 *     """LU Doolittle's decomposition"""
 *     cdef int n, i, k, j, max_i, iterat
 */

static int __pyx_f_9pylsewave_5cynum_cLUdecomp(__Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_seq, struct __pyx_opt_args_9pylsewave_5cynum_cLUdecomp *__pyx_optional_args) {
  double __pyx_v_tol = ((double)1.0e-09);
  int __pyx_v_n;
  int __pyx_v_i;
  int __pyx_v_k;
  int __pyx_v_j;
  int __pyx_v_max_i;
  int __pyx_v_iterat;
  double __pyx_v_lam;
  double __pyx_v_max_value;
  __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_p;
  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;
  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  long __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;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  int __pyx_t_33;
  int __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  __Pyx_RefNannySetupContext("cLUdecomp", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tol = __pyx_optional_args->tol;
    }
  }

  /* "pylsewave/cynum.pyx":2892
 *     cdef double[::1] s
 * 
 *     n = a.shape[0]             # <<<<<<<<<<<<<<
 *     s = np.zeros(n, dtype=np.float)
 * 
 */
  __pyx_v_n = (__pyx_v_a.shape[0]);

  /* "pylsewave/cynum.pyx":2893
 * 
 *     n = a.shape[0]
 *     s = np.zeros(n, dtype=np.float)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2893, __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_ERR(0, 2893, __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_ERR(0, 2893, __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;
  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_5);
  if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 2893, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_s = __pyx_t_6;
  __pyx_t_6.memview = NULL;
  __pyx_t_6.data = NULL;

  /* "pylsewave/cynum.pyx":2895
 *     s = np.zeros(n, dtype=np.float)
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         max_value = 0.0
 *         seq[i] = i
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pylsewave/cynum.pyx":2896
 * 
 *     for i in range(n):
 *         max_value = 0.0             # <<<<<<<<<<<<<<
 *         seq[i] = i
 *         for j in range(a.shape[1]):
 */
    __pyx_v_max_value = 0.0;

    /* "pylsewave/cynum.pyx":2897
 *     for i in range(n):
 *         max_value = 0.0
 *         seq[i] = i             # <<<<<<<<<<<<<<
 *         for j in range(a.shape[1]):
 *             if (fabs(a[i, j]) > max_value):
 */
    __pyx_t_9 = __pyx_v_i;
    if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_seq.shape[0];
    *((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_seq.data) + __pyx_t_9)) )) = __pyx_v_i;

    /* "pylsewave/cynum.pyx":2898
 *         max_value = 0.0
 *         seq[i] = i
 *         for j in range(a.shape[1]):             # <<<<<<<<<<<<<<
 *             if (fabs(a[i, j]) > max_value):
 *                 max_value = fabs(a[i, j])
 */
    __pyx_t_10 = (__pyx_v_a.shape[1]);
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_j = __pyx_t_11;

      /* "pylsewave/cynum.pyx":2899
 *         seq[i] = i
 *         for j in range(a.shape[1]):
 *             if (fabs(a[i, j]) > max_value):             # <<<<<<<<<<<<<<
 *                 max_value = fabs(a[i, j])
 *         s[i] = max_value
 */
      __pyx_t_12 = __pyx_v_i;
      __pyx_t_13 = __pyx_v_j;
      if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_a.shape[0];
      if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_a.shape[1];
      __pyx_t_14 = ((fabs((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_12 * __pyx_v_a.strides[0]) )) + __pyx_t_13)) )))) > __pyx_v_max_value) != 0);
      if (__pyx_t_14) {

        /* "pylsewave/cynum.pyx":2900
 *         for j in range(a.shape[1]):
 *             if (fabs(a[i, j]) > max_value):
 *                 max_value = fabs(a[i, j])             # <<<<<<<<<<<<<<
 *         s[i] = max_value
 * 
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_a.shape[0];
        if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_a.shape[1];
        __pyx_v_max_value = fabs((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_15 * __pyx_v_a.strides[0]) )) + __pyx_t_16)) ))));

        /* "pylsewave/cynum.pyx":2899
 *         seq[i] = i
 *         for j in range(a.shape[1]):
 *             if (fabs(a[i, j]) > max_value):             # <<<<<<<<<<<<<<
 *                 max_value = fabs(a[i, j])
 *         s[i] = max_value
 */
      }
    }

    /* "pylsewave/cynum.pyx":2901
 *             if (fabs(a[i, j]) > max_value):
 *                 max_value = fabs(a[i, j])
 *         s[i] = max_value             # <<<<<<<<<<<<<<
 * 
 *     for k in range(0, n-1):
 */
    __pyx_t_17 = __pyx_v_i;
    if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_s.shape[0];
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_17)) )) = __pyx_v_max_value;
  }

  /* "pylsewave/cynum.pyx":2903
 *         s[i] = max_value
 * 
 *     for k in range(0, n-1):             # <<<<<<<<<<<<<<
 *         max_value = 0.0
 *         max_i = 0
 */
  __pyx_t_18 = (__pyx_v_n - 1);
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_18; __pyx_t_7+=1) {
    __pyx_v_k = __pyx_t_7;

    /* "pylsewave/cynum.pyx":2904
 * 
 *     for k in range(0, n-1):
 *         max_value = 0.0             # <<<<<<<<<<<<<<
 *         max_i = 0
 *         iterat = 0
 */
    __pyx_v_max_value = 0.0;

    /* "pylsewave/cynum.pyx":2905
 *     for k in range(0, n-1):
 *         max_value = 0.0
 *         max_i = 0             # <<<<<<<<<<<<<<
 *         iterat = 0
 *         for j in range(k, n):
 */
    __pyx_v_max_i = 0;

    /* "pylsewave/cynum.pyx":2906
 *         max_value = 0.0
 *         max_i = 0
 *         iterat = 0             # <<<<<<<<<<<<<<
 *         for j in range(k, n):
 *             if (abs(a[j,k])/s[j] > max_value):
 */
    __pyx_v_iterat = 0;

    /* "pylsewave/cynum.pyx":2907
 *         max_i = 0
 *         iterat = 0
 *         for j in range(k, n):             # <<<<<<<<<<<<<<
 *             if (abs(a[j,k])/s[j] > max_value):
 *                 max_value = abs(a[j,k])/s[j]
 */
    __pyx_t_8 = __pyx_v_n;
    for (__pyx_t_11 = __pyx_v_k; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
      __pyx_v_j = __pyx_t_11;

      /* "pylsewave/cynum.pyx":2908
 *         iterat = 0
 *         for j in range(k, n):
 *             if (abs(a[j,k])/s[j] > max_value):             # <<<<<<<<<<<<<<
 *                 max_value = abs(a[j,k])/s[j]
 *                 max_i = iterat
 */
      __pyx_t_19 = __pyx_v_j;
      __pyx_t_20 = __pyx_v_k;
      if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_a.shape[0];
      if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_a.shape[1];
      __pyx_t_21 = __pyx_v_j;
      if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_v_s.shape[0];
      __pyx_t_14 = (((fabs((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_19 * __pyx_v_a.strides[0]) )) + __pyx_t_20)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_21)) )))) > __pyx_v_max_value) != 0);
      if (__pyx_t_14) {

        /* "pylsewave/cynum.pyx":2909
 *         for j in range(k, n):
 *             if (abs(a[j,k])/s[j] > max_value):
 *                 max_value = abs(a[j,k])/s[j]             # <<<<<<<<<<<<<<
 *                 max_i = iterat
 *             iterat= iterat + 1
 */
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_23 = __pyx_v_k;
        if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_v_a.shape[0];
        if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_v_a.shape[1];
        __pyx_t_24 = __pyx_v_j;
        if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_s.shape[0];
        __pyx_v_max_value = (fabs((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_22 * __pyx_v_a.strides[0]) )) + __pyx_t_23)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_24)) ))));

        /* "pylsewave/cynum.pyx":2910
 *             if (abs(a[j,k])/s[j] > max_value):
 *                 max_value = abs(a[j,k])/s[j]
 *                 max_i = iterat             # <<<<<<<<<<<<<<
 *             iterat= iterat + 1
 *         p = max_i + k
 */
        __pyx_v_max_i = __pyx_v_iterat;

        /* "pylsewave/cynum.pyx":2908
 *         iterat = 0
 *         for j in range(k, n):
 *             if (abs(a[j,k])/s[j] > max_value):             # <<<<<<<<<<<<<<
 *                 max_value = abs(a[j,k])/s[j]
 *                 max_i = iterat
 */
      }

      /* "pylsewave/cynum.pyx":2911
 *                 max_value = abs(a[j,k])/s[j]
 *                 max_i = iterat
 *             iterat= iterat + 1             # <<<<<<<<<<<<<<
 *         p = max_i + k
 * 
 */
      __pyx_v_iterat = (__pyx_v_iterat + 1);
    }

    /* "pylsewave/cynum.pyx":2912
 *                 max_i = iterat
 *             iterat= iterat + 1
 *         p = max_i + k             # <<<<<<<<<<<<<<
 * 
 *         if abs(a[p, k]) < tol:
 */
    __pyx_v_p = (__pyx_v_max_i + __pyx_v_k);

    /* "pylsewave/cynum.pyx":2914
 *         p = max_i + k
 * 
 *         if abs(a[p, k]) < tol:             # <<<<<<<<<<<<<<
 *             return -1
 *         if p != k:
 */
    __pyx_t_25 = __pyx_v_p;
    __pyx_t_26 = __pyx_v_k;
    if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_a.shape[0];
    if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_a.shape[1];
    __pyx_t_14 = ((fabs((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_25 * __pyx_v_a.strides[0]) )) + __pyx_t_26)) )))) < __pyx_v_tol) != 0);
    if (__pyx_t_14) {

      /* "pylsewave/cynum.pyx":2915
 * 
 *         if abs(a[p, k]) < tol:
 *             return -1             # <<<<<<<<<<<<<<
 *         if p != k:
 *             swaprowsVd(s, k, p)
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "pylsewave/cynum.pyx":2914
 *         p = max_i + k
 * 
 *         if abs(a[p, k]) < tol:             # <<<<<<<<<<<<<<
 *             return -1
 *         if p != k:
 */
    }

    /* "pylsewave/cynum.pyx":2916
 *         if abs(a[p, k]) < tol:
 *             return -1
 *         if p != k:             # <<<<<<<<<<<<<<
 *             swaprowsVd(s, k, p)
 *             swaprows(a, k, p)
 */
    __pyx_t_14 = ((__pyx_v_p != __pyx_v_k) != 0);
    if (__pyx_t_14) {

      /* "pylsewave/cynum.pyx":2917
 *             return -1
 *         if p != k:
 *             swaprowsVd(s, k, p)             # <<<<<<<<<<<<<<
 *             swaprows(a, k, p)
 *             swaprowsVi(seq, k, p)
 */
      __pyx_f_9pylsewave_5cynum_swaprowsVd(__pyx_v_s, __pyx_v_k, __pyx_v_p);

      /* "pylsewave/cynum.pyx":2918
 *         if p != k:
 *             swaprowsVd(s, k, p)
 *             swaprows(a, k, p)             # <<<<<<<<<<<<<<
 *             swaprowsVi(seq, k, p)
 * 
 */
      __pyx_f_9pylsewave_5cynum_swaprows(__pyx_v_a, __pyx_v_k, __pyx_v_p);

      /* "pylsewave/cynum.pyx":2919
 *             swaprowsVd(s, k, p)
 *             swaprows(a, k, p)
 *             swaprowsVi(seq, k, p)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(k+1, n):
 */
      __pyx_f_9pylsewave_5cynum_swaprowsVi(__pyx_v_seq, __pyx_v_k, __pyx_v_p);

      /* "pylsewave/cynum.pyx":2916
 *         if abs(a[p, k]) < tol:
 *             return -1
 *         if p != k:             # <<<<<<<<<<<<<<
 *             swaprowsVd(s, k, p)
 *             swaprows(a, k, p)
 */
    }

    /* "pylsewave/cynum.pyx":2921
 *             swaprowsVi(seq, k, p)
 * 
 *         for i in range(k+1, n):             # <<<<<<<<<<<<<<
 *             if a[i, k] != 0.0:
 *                 lam = a[i, k] / a[k, k]
 */
    __pyx_t_8 = __pyx_v_n;
    for (__pyx_t_11 = (__pyx_v_k + 1); __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "pylsewave/cynum.pyx":2922
 * 
 *         for i in range(k+1, n):
 *             if a[i, k] != 0.0:             # <<<<<<<<<<<<<<
 *                 lam = a[i, k] / a[k, k]
 *                 for j in range(k+1, n):
 */
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = __pyx_v_k;
      if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_a.shape[0];
      if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_v_a.shape[1];
      __pyx_t_14 = (((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_27 * __pyx_v_a.strides[0]) )) + __pyx_t_28)) ))) != 0.0) != 0);
      if (__pyx_t_14) {

        /* "pylsewave/cynum.pyx":2923
 *         for i in range(k+1, n):
 *             if a[i, k] != 0.0:
 *                 lam = a[i, k] / a[k, k]             # <<<<<<<<<<<<<<
 *                 for j in range(k+1, n):
 *                     a[i, j] = a[i, j] - lam*a[k, j]
 */
        __pyx_t_29 = __pyx_v_i;
        __pyx_t_30 = __pyx_v_k;
        if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_v_a.shape[0];
        if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_v_a.shape[1];
        __pyx_t_31 = __pyx_v_k;
        __pyx_t_32 = __pyx_v_k;
        if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_a.shape[0];
        if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_v_a.shape[1];
        __pyx_v_lam = ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_29 * __pyx_v_a.strides[0]) )) + __pyx_t_30)) ))) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_31 * __pyx_v_a.strides[0]) )) + __pyx_t_32)) ))));

        /* "pylsewave/cynum.pyx":2924
 *             if a[i, k] != 0.0:
 *                 lam = a[i, k] / a[k, k]
 *                 for j in range(k+1, n):             # <<<<<<<<<<<<<<
 *                     a[i, j] = a[i, j] - lam*a[k, j]
 *                 a[i, k] = lam
 */
        __pyx_t_33 = __pyx_v_n;
        for (__pyx_t_34 = (__pyx_v_k + 1); __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) {
          __pyx_v_j = __pyx_t_34;

          /* "pylsewave/cynum.pyx":2925
 *                 lam = a[i, k] / a[k, k]
 *                 for j in range(k+1, n):
 *                     a[i, j] = a[i, j] - lam*a[k, j]             # <<<<<<<<<<<<<<
 *                 a[i, k] = lam
 *     return 0
 */
          __pyx_t_35 = __pyx_v_i;
          __pyx_t_36 = __pyx_v_j;
          if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_a.shape[0];
          if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_a.shape[1];
          __pyx_t_37 = __pyx_v_k;
          __pyx_t_38 = __pyx_v_j;
          if (__pyx_t_37 < 0) __pyx_t_37 += __pyx_v_a.shape[0];
          if (__pyx_t_38 < 0) __pyx_t_38 += __pyx_v_a.shape[1];
          __pyx_t_39 = __pyx_v_i;
          __pyx_t_40 = __pyx_v_j;
          if (__pyx_t_39 < 0) __pyx_t_39 += __pyx_v_a.shape[0];
          if (__pyx_t_40 < 0) __pyx_t_40 += __pyx_v_a.shape[1];
          *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_39 * __pyx_v_a.strides[0]) )) + __pyx_t_40)) )) = ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_35 * __pyx_v_a.strides[0]) )) + __pyx_t_36)) ))) - (__pyx_v_lam * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_37 * __pyx_v_a.strides[0]) )) + __pyx_t_38)) )))));
        }

        /* "pylsewave/cynum.pyx":2926
 *                 for j in range(k+1, n):
 *                     a[i, j] = a[i, j] - lam*a[k, j]
 *                 a[i, k] = lam             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_k;
        if (__pyx_t_41 < 0) __pyx_t_41 += __pyx_v_a.shape[0];
        if (__pyx_t_42 < 0) __pyx_t_42 += __pyx_v_a.shape[1];
        *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_41 * __pyx_v_a.strides[0]) )) + __pyx_t_42)) )) = __pyx_v_lam;

        /* "pylsewave/cynum.pyx":2922
 * 
 *         for i in range(k+1, n):
 *             if a[i, k] != 0.0:             # <<<<<<<<<<<<<<
 *                 lam = a[i, k] / a[k, k]
 *                 for j in range(k+1, n):
 */
      }
    }
  }

  /* "pylsewave/cynum.pyx":2927
 *                     a[i, j] = a[i, j] - lam*a[k, j]
 *                 a[i, k] = lam
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":2886
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cdef int cLUdecomp(double[:,::1] a, int[::1] seq, double tol=1.0e-09):             # <<<<<<<<<<<<<<
 *     """LU Doolittle's decomposition"""
 *     cdef int n, i, k, j, max_i, iterat
 */

  /* 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_XDEC_MEMVIEW(&__pyx_t_6, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.cLUdecomp", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":2931
 * @cython.cdivision(True)
 * @cython.boundscheck(False)
 * cdef int cLUsolve(double[:, ::1] a, double[::1] b, int[::1] seq, double[::1] out):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t n, siz, i, j, k
 *     cdef double sums
 */

static int __pyx_f_9pylsewave_5cynum_cLUsolve(__Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b, __Pyx_memviewslice __pyx_v_seq, __Pyx_memviewslice __pyx_v_out) {
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  double __pyx_v_sums;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  __Pyx_RefNannySetupContext("cLUsolve", 0);

  /* "pylsewave/cynum.pyx":2935
 *     cdef double sums
 * 
 *     cLUdecomp(a, seq)             # <<<<<<<<<<<<<<
 * 
 *     n = a.shape[0]
 */
  __pyx_f_9pylsewave_5cynum_cLUdecomp(__pyx_v_a, __pyx_v_seq, NULL);

  /* "pylsewave/cynum.pyx":2937
 *     cLUdecomp(a, seq)
 * 
 *     n = a.shape[0]             # <<<<<<<<<<<<<<
 *     for i in range(out.shape[0]):
 *         out[i] = b[seq[i]]
 */
  __pyx_v_n = (__pyx_v_a.shape[0]);

  /* "pylsewave/cynum.pyx":2938
 * 
 *     n = a.shape[0]
 *     for i in range(out.shape[0]):             # <<<<<<<<<<<<<<
 *         out[i] = b[seq[i]]
 * 
 */
  __pyx_t_1 = (__pyx_v_out.shape[0]);
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2939
 *     n = a.shape[0]
 *     for i in range(out.shape[0]):
 *         out[i] = b[seq[i]]             # <<<<<<<<<<<<<<
 * 
 *     for k in range(1, n):
 */
    __pyx_t_3 = __pyx_v_i;
    if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_seq.shape[0];
    __pyx_t_4 = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_seq.data) + __pyx_t_3)) )));
    if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_b.shape[0];
    __pyx_t_5 = __pyx_v_i;
    if (__pyx_t_5 < 0) __pyx_t_5 += __pyx_v_out.shape[0];
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_5)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_4)) )));
  }

  /* "pylsewave/cynum.pyx":2941
 *         out[i] = b[seq[i]]
 * 
 *     for k in range(1, n):             # <<<<<<<<<<<<<<
 *         sums = 0.0
 *         for i in range(0, k):
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 1; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_k = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2942
 * 
 *     for k in range(1, n):
 *         sums = 0.0             # <<<<<<<<<<<<<<
 *         for i in range(0, k):
 *             sums = sums + a[k, i]*out[i]
 */
    __pyx_v_sums = 0.0;

    /* "pylsewave/cynum.pyx":2943
 *     for k in range(1, n):
 *         sums = 0.0
 *         for i in range(0, k):             # <<<<<<<<<<<<<<
 *             sums = sums + a[k, i]*out[i]
 *         out[k] = out[k] - sums
 */
    __pyx_t_6 = __pyx_v_k;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "pylsewave/cynum.pyx":2944
 *         sums = 0.0
 *         for i in range(0, k):
 *             sums = sums + a[k, i]*out[i]             # <<<<<<<<<<<<<<
 *         out[k] = out[k] - sums
 * 
 */
      __pyx_t_8 = __pyx_v_k;
      __pyx_t_9 = __pyx_v_i;
      if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_a.shape[0];
      if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_a.shape[1];
      __pyx_t_10 = __pyx_v_i;
      if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_out.shape[0];
      __pyx_v_sums = (__pyx_v_sums + ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_8 * __pyx_v_a.strides[0]) )) + __pyx_t_9)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_10)) )))));
    }

    /* "pylsewave/cynum.pyx":2945
 *         for i in range(0, k):
 *             sums = sums + a[k, i]*out[i]
 *         out[k] = out[k] - sums             # <<<<<<<<<<<<<<
 * 
 *     for j in range(n):
 */
    __pyx_t_11 = __pyx_v_k;
    if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_out.shape[0];
    __pyx_t_12 = __pyx_v_k;
    if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_out.shape[0];
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_12)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_11)) ))) - __pyx_v_sums);
  }

  /* "pylsewave/cynum.pyx":2947
 *         out[k] = out[k] - sums
 * 
 *     for j in range(n):             # <<<<<<<<<<<<<<
 *         k = n - 1 - j
 *         sums = 0.0
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_j = __pyx_t_2;

    /* "pylsewave/cynum.pyx":2948
 * 
 *     for j in range(n):
 *         k = n - 1 - j             # <<<<<<<<<<<<<<
 *         sums = 0.0
 *         for i in range(k+1, n):
 */
    __pyx_v_k = ((__pyx_v_n - 1) - __pyx_v_j);

    /* "pylsewave/cynum.pyx":2949
 *     for j in range(n):
 *         k = n - 1 - j
 *         sums = 0.0             # <<<<<<<<<<<<<<
 *         for i in range(k+1, n):
 *             sums = sums + a[k, i]*out[i]
 */
    __pyx_v_sums = 0.0;

    /* "pylsewave/cynum.pyx":2950
 *         k = n - 1 - j
 *         sums = 0.0
 *         for i in range(k+1, n):             # <<<<<<<<<<<<<<
 *             sums = sums + a[k, i]*out[i]
 *         out[k] = (out[k] - sums)/a[k, k]
 */
    __pyx_t_6 = __pyx_v_n;
    for (__pyx_t_7 = (__pyx_v_k + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "pylsewave/cynum.pyx":2951
 *         sums = 0.0
 *         for i in range(k+1, n):
 *             sums = sums + a[k, i]*out[i]             # <<<<<<<<<<<<<<
 *         out[k] = (out[k] - sums)/a[k, k]
 *     return 0
 */
      __pyx_t_13 = __pyx_v_k;
      __pyx_t_14 = __pyx_v_i;
      if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_a.shape[0];
      if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_a.shape[1];
      __pyx_t_15 = __pyx_v_i;
      if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_out.shape[0];
      __pyx_v_sums = (__pyx_v_sums + ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_13 * __pyx_v_a.strides[0]) )) + __pyx_t_14)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_15)) )))));
    }

    /* "pylsewave/cynum.pyx":2952
 *         for i in range(k+1, n):
 *             sums = sums + a[k, i]*out[i]
 *         out[k] = (out[k] - sums)/a[k, k]             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
    __pyx_t_16 = __pyx_v_k;
    if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_out.shape[0];
    __pyx_t_17 = __pyx_v_k;
    __pyx_t_18 = __pyx_v_k;
    if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_a.shape[0];
    if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_a.shape[1];
    __pyx_t_19 = __pyx_v_k;
    if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_out.shape[0];
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_19)) )) = (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out.data) + __pyx_t_16)) ))) - __pyx_v_sums) / (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_17 * __pyx_v_a.strides[0]) )) + __pyx_t_18)) ))));
  }

  /* "pylsewave/cynum.pyx":2953
 *             sums = sums + a[k, i]*out[i]
 *         out[k] = (out[k] - sums)/a[k, k]
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * @cython.initializedcheck(False)
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":2931
 * @cython.cdivision(True)
 * @cython.boundscheck(False)
 * cdef int cLUsolve(double[:, ::1] a, double[::1] b, int[::1] seq, double[::1] out):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t n, siz, i, j, k
 *     cdef double sums
 */

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

/* "pylsewave/cynum.pyx":2959
 * @cython.wraparound(False)
 * @cython.cdivision(True)
 * cdef int Newton_Raphson_Sys_bif(cBCs bcs, double[::1] x, double[::1] u, double dt, int[::1] vessel_indices,             # <<<<<<<<<<<<<<
 *                                 double eps, int N=100):
 *     cdef Py_ssize_t n, siz, i, j
 */

static int __pyx_f_9pylsewave_5cynum_Newton_Raphson_Sys_bif(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_bcs, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_indices, double __pyx_v_eps, struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_bif *__pyx_optional_args) {
  int __pyx_v_N = ((int)0x64);
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_i;
  int __pyx_v_iter_count;
  double __pyx_v_norm;
  __Pyx_memviewslice __pyx_v_R_value = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_delta = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_J_value = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_seq = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __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;
  Py_ssize_t __pyx_t_20;
  __Pyx_RefNannySetupContext("Newton_Raphson_Sys_bif", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }

  /* "pylsewave/cynum.pyx":2969
 *     cdef int[::1] seq
 * 
 *     n = x.shape[0]             # <<<<<<<<<<<<<<
 *     #transfer these funcs before solution as class attributes
 * 
 */
  __pyx_v_n = (__pyx_v_x.shape[0]);

  /* "pylsewave/cynum.pyx":2972
 *     #transfer these funcs before solution as class attributes
 * 
 *     R_value = np.zeros(n, np.float)             # <<<<<<<<<<<<<<
 *     delta = np.zeros(n, np.float)
 *     J_value = np.zeros((n, n), dtype=np.float)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2972, __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_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 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_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2972, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_R_value = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2973
 * 
 *     R_value = np.zeros(n, np.float)
 *     delta = np.zeros(n, np.float)             # <<<<<<<<<<<<<<
 *     J_value = np.zeros((n, n), dtype=np.float)
 *     seq = np.zeros(n, dtype=np.int)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_delta = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":2974
 *     R_value = np.zeros(n, np.float)
 *     delta = np.zeros(n, np.float)
 *     J_value = np.zeros((n, n), dtype=np.float)             # <<<<<<<<<<<<<<
 *     seq = np.zeros(n, dtype=np.int)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_3);
  if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 2974, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_J_value = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "pylsewave/cynum.pyx":2975
 *     delta = np.zeros(n, np.float)
 *     J_value = np.zeros((n, n), dtype=np.float)
 *     seq = np.zeros(n, dtype=np.int)             # <<<<<<<<<<<<<<
 * 
 *     bcs.bifurcation_R(x, u, dt, vessel_indices, R_value)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_1);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seq = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "pylsewave/cynum.pyx":2977
 *     seq = np.zeros(n, dtype=np.int)
 * 
 *     bcs.bifurcation_R(x, u, dt, vessel_indices, R_value)             # <<<<<<<<<<<<<<
 *     norm = norm2(R_value)
 * 
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_bcs->__pyx_vtab)->bifurcation_R(__pyx_v_bcs, __pyx_v_x, __pyx_v_u, __pyx_v_dt, __pyx_v_vessel_indices, __pyx_v_R_value);

  /* "pylsewave/cynum.pyx":2978
 * 
 *     bcs.bifurcation_R(x, u, dt, vessel_indices, R_value)
 *     norm = norm2(R_value)             # <<<<<<<<<<<<<<
 * 
 *     # we need to solve to negative R value
 */
  __pyx_v_norm = __pyx_f_9pylsewave_5cynum_norm2(__pyx_v_R_value, 0);

  /* "pylsewave/cynum.pyx":2981
 * 
 *     # we need to solve to negative R value
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         R_value[i] = -R_value[i]
 * 
 */
  __pyx_t_6 = __pyx_v_n;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_6; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pylsewave/cynum.pyx":2982
 *     # we need to solve to negative R value
 *     for i in range(n):
 *         R_value[i] = -R_value[i]             # <<<<<<<<<<<<<<
 * 
 *     iter_count = 0
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_R_value.data) + __pyx_t_13)) )) = (-(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_R_value.data) + __pyx_t_12)) ))));
  }

  /* "pylsewave/cynum.pyx":2984
 *         R_value[i] = -R_value[i]
 * 
 *     iter_count = 0             # <<<<<<<<<<<<<<
 *     while fabs(norm) > eps and iter_count < N:
 *         bcs.bifurcation_Jr(x, vessel_indices, J_value)
 */
  __pyx_v_iter_count = 0;

  /* "pylsewave/cynum.pyx":2985
 * 
 *     iter_count = 0
 *     while fabs(norm) > eps and iter_count < N:             # <<<<<<<<<<<<<<
 *         bcs.bifurcation_Jr(x, vessel_indices, J_value)
 *         cLUsolve(J_value, R_value, seq, delta)
 */
  while (1) {
    __pyx_t_15 = ((fabs(__pyx_v_norm) > __pyx_v_eps) != 0);
    if (__pyx_t_15) {
    } else {
      __pyx_t_14 = __pyx_t_15;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_15 = ((__pyx_v_iter_count < __pyx_v_N) != 0);
    __pyx_t_14 = __pyx_t_15;
    __pyx_L7_bool_binop_done:;
    if (!__pyx_t_14) break;

    /* "pylsewave/cynum.pyx":2986
 *     iter_count = 0
 *     while fabs(norm) > eps and iter_count < N:
 *         bcs.bifurcation_Jr(x, vessel_indices, J_value)             # <<<<<<<<<<<<<<
 *         cLUsolve(J_value, R_value, seq, delta)
 *         for i in range(n):
 */
    ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_bcs->__pyx_vtab)->bifurcation_Jr(__pyx_v_bcs, __pyx_v_x, __pyx_v_vessel_indices, __pyx_v_J_value);

    /* "pylsewave/cynum.pyx":2987
 *     while fabs(norm) > eps and iter_count < N:
 *         bcs.bifurcation_Jr(x, vessel_indices, J_value)
 *         cLUsolve(J_value, R_value, seq, delta)             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             x[i] = x[i] + delta[i]
 */
    __pyx_f_9pylsewave_5cynum_cLUsolve(__pyx_v_J_value, __pyx_v_R_value, __pyx_v_seq, __pyx_v_delta);

    /* "pylsewave/cynum.pyx":2988
 *         bcs.bifurcation_Jr(x, vessel_indices, J_value)
 *         cLUsolve(J_value, R_value, seq, delta)
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             x[i] = x[i] + delta[i]
 *         bcs.bifurcation_R(x, u, dt, vessel_indices, R_value)
 */
    __pyx_t_6 = __pyx_v_n;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_6; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "pylsewave/cynum.pyx":2989
 *         cLUsolve(J_value, R_value, seq, delta)
 *         for i in range(n):
 *             x[i] = x[i] + delta[i]             # <<<<<<<<<<<<<<
 *         bcs.bifurcation_R(x, u, dt, vessel_indices, R_value)
 *         norm = norm2(R_value)
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = __pyx_v_i;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_18)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_16)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_delta.data) + __pyx_t_17)) ))));
    }

    /* "pylsewave/cynum.pyx":2990
 *         for i in range(n):
 *             x[i] = x[i] + delta[i]
 *         bcs.bifurcation_R(x, u, dt, vessel_indices, R_value)             # <<<<<<<<<<<<<<
 *         norm = norm2(R_value)
 *         for i in range(n):
 */
    ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_bcs->__pyx_vtab)->bifurcation_R(__pyx_v_bcs, __pyx_v_x, __pyx_v_u, __pyx_v_dt, __pyx_v_vessel_indices, __pyx_v_R_value);

    /* "pylsewave/cynum.pyx":2991
 *             x[i] = x[i] + delta[i]
 *         bcs.bifurcation_R(x, u, dt, vessel_indices, R_value)
 *         norm = norm2(R_value)             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             R_value[i] = -R_value[i]
 */
    __pyx_v_norm = __pyx_f_9pylsewave_5cynum_norm2(__pyx_v_R_value, 0);

    /* "pylsewave/cynum.pyx":2992
 *         bcs.bifurcation_R(x, u, dt, vessel_indices, R_value)
 *         norm = norm2(R_value)
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             R_value[i] = -R_value[i]
 *         iter_count += 1
 */
    __pyx_t_6 = __pyx_v_n;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_6; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "pylsewave/cynum.pyx":2993
 *         norm = norm2(R_value)
 *         for i in range(n):
 *             R_value[i] = -R_value[i]             # <<<<<<<<<<<<<<
 *         iter_count += 1
 *     if fabs(norm) > eps:
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_20 = __pyx_v_i;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_R_value.data) + __pyx_t_20)) )) = (-(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_R_value.data) + __pyx_t_19)) ))));
    }

    /* "pylsewave/cynum.pyx":2994
 *         for i in range(n):
 *             R_value[i] = -R_value[i]
 *         iter_count += 1             # <<<<<<<<<<<<<<
 *     if fabs(norm) > eps:
 *         iter_count = -1
 */
    __pyx_v_iter_count = (__pyx_v_iter_count + 1);
  }

  /* "pylsewave/cynum.pyx":2995
 *             R_value[i] = -R_value[i]
 *         iter_count += 1
 *     if fabs(norm) > eps:             # <<<<<<<<<<<<<<
 *         iter_count = -1
 *     return iter_count
 */
  __pyx_t_14 = ((fabs(__pyx_v_norm) > __pyx_v_eps) != 0);
  if (__pyx_t_14) {

    /* "pylsewave/cynum.pyx":2996
 *         iter_count += 1
 *     if fabs(norm) > eps:
 *         iter_count = -1             # <<<<<<<<<<<<<<
 *     return iter_count
 * 
 */
    __pyx_v_iter_count = -1;

    /* "pylsewave/cynum.pyx":2995
 *             R_value[i] = -R_value[i]
 *         iter_count += 1
 *     if fabs(norm) > eps:             # <<<<<<<<<<<<<<
 *         iter_count = -1
 *     return iter_count
 */
  }

  /* "pylsewave/cynum.pyx":2997
 *     if fabs(norm) > eps:
 *         iter_count = -1
 *     return iter_count             # <<<<<<<<<<<<<<
 * 
 * @cython.initializedcheck(False)
 */
  __pyx_r = __pyx_v_iter_count;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":2959
 * @cython.wraparound(False)
 * @cython.cdivision(True)
 * cdef int Newton_Raphson_Sys_bif(cBCs bcs, double[::1] x, double[::1] u, double dt, int[::1] vessel_indices,             # <<<<<<<<<<<<<<
 *                                 double eps, int N=100):
 *     cdef Py_ssize_t n, siz, i, j
 */

  /* 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);
  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.Newton_Raphson_Sys_bif", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_R_value, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_delta, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_J_value, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_seq, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":3003
 * @cython.wraparound(False)
 * @cython.cdivision(True)
 * cdef int Newton_Raphson_Sys_conj(cBCs bcs, double[::1] x, double[::1] u, double dt, int[::1] vessel_indices,             # <<<<<<<<<<<<<<
 *                                  double eps, int N=100):
 *     cdef Py_ssize_t n, siz, i
 */

static int __pyx_f_9pylsewave_5cynum_Newton_Raphson_Sys_conj(struct __pyx_obj_9pylsewave_5cynum_cBCs *__pyx_v_bcs, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_u, double __pyx_v_dt, __Pyx_memviewslice __pyx_v_vessel_indices, double __pyx_v_eps, struct __pyx_opt_args_9pylsewave_5cynum_Newton_Raphson_Sys_conj *__pyx_optional_args) {
  int __pyx_v_N = ((int)0x64);
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_i;
  int __pyx_v_iter_count;
  double __pyx_v_norm;
  __Pyx_memviewslice __pyx_v_R_value = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_delta = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_J_value = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_v_seq = { 0, 0, { 0 }, { 0 }, { 0 } };
  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;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __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;
  Py_ssize_t __pyx_t_20;
  __Pyx_RefNannySetupContext("Newton_Raphson_Sys_conj", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }

  /* "pylsewave/cynum.pyx":3012
 *     cdef double[:, ::1] J_value
 *     cdef int[::1] seq
 *     n = x.shape[0]             # <<<<<<<<<<<<<<
 * 
 *     #transfer these funcs before solution as class attributes
 */
  __pyx_v_n = (__pyx_v_x.shape[0]);

  /* "pylsewave/cynum.pyx":3016
 *     #transfer these funcs before solution as class attributes
 * 
 *     R_value = np.zeros(n, np.float)             # <<<<<<<<<<<<<<
 *     delta = np.zeros(n, np.float)
 *     J_value = np.zeros((n, n), dtype=np.float)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3016, __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_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 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_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 3016, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_R_value = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":3017
 * 
 *     R_value = np.zeros(n, np.float)
 *     delta = np.zeros(n, np.float)             # <<<<<<<<<<<<<<
 *     J_value = np.zeros((n, n), dtype=np.float)
 *     seq = np.zeros(n, dtype=np.int)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1);
  if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 3017, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_delta = __pyx_t_8;
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;

  /* "pylsewave/cynum.pyx":3018
 *     R_value = np.zeros(n, np.float)
 *     delta = np.zeros(n, np.float)
 *     J_value = np.zeros((n, n), dtype=np.float)             # <<<<<<<<<<<<<<
 *     seq = np.zeros(n, dtype=np.int)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_3);
  if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 3018, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_J_value = __pyx_t_9;
  __pyx_t_9.memview = NULL;
  __pyx_t_9.data = NULL;

  /* "pylsewave/cynum.pyx":3019
 *     delta = np.zeros(n, np.float)
 *     J_value = np.zeros((n, n), dtype=np.float)
 *     seq = np.zeros(n, dtype=np.int)             # <<<<<<<<<<<<<<
 * 
 *     bcs.conjuction_R(x, u, dt, vessel_indices, R_value)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_t_1);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 3019, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seq = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "pylsewave/cynum.pyx":3021
 *     seq = np.zeros(n, dtype=np.int)
 * 
 *     bcs.conjuction_R(x, u, dt, vessel_indices, R_value)             # <<<<<<<<<<<<<<
 * 
 *     norm = norm2(R_value)
 */
  ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_bcs->__pyx_vtab)->conjuction_R(__pyx_v_bcs, __pyx_v_x, __pyx_v_u, __pyx_v_dt, __pyx_v_vessel_indices, __pyx_v_R_value, 0);

  /* "pylsewave/cynum.pyx":3023
 *     bcs.conjuction_R(x, u, dt, vessel_indices, R_value)
 * 
 *     norm = norm2(R_value)             # <<<<<<<<<<<<<<
 * 
 *     #we need to solve to negative R value
 */
  __pyx_v_norm = __pyx_f_9pylsewave_5cynum_norm2(__pyx_v_R_value, 0);

  /* "pylsewave/cynum.pyx":3026
 * 
 *     #we need to solve to negative R value
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         R_value[i] = -R_value[i]
 *     iter_count = 0
 */
  __pyx_t_6 = __pyx_v_n;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_6; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pylsewave/cynum.pyx":3027
 *     #we need to solve to negative R value
 *     for i in range(n):
 *         R_value[i] = -R_value[i]             # <<<<<<<<<<<<<<
 *     iter_count = 0
 *     while fabs(norm) > eps and iter_count < N:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_R_value.data) + __pyx_t_13)) )) = (-(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_R_value.data) + __pyx_t_12)) ))));
  }

  /* "pylsewave/cynum.pyx":3028
 *     for i in range(n):
 *         R_value[i] = -R_value[i]
 *     iter_count = 0             # <<<<<<<<<<<<<<
 *     while fabs(norm) > eps and iter_count < N:
 *         bcs.conjuction_Jr(x, vessel_indices, J_value)
 */
  __pyx_v_iter_count = 0;

  /* "pylsewave/cynum.pyx":3029
 *         R_value[i] = -R_value[i]
 *     iter_count = 0
 *     while fabs(norm) > eps and iter_count < N:             # <<<<<<<<<<<<<<
 *         bcs.conjuction_Jr(x, vessel_indices, J_value)
 *         cLUsolve(J_value, R_value, seq, delta)
 */
  while (1) {
    __pyx_t_15 = ((fabs(__pyx_v_norm) > __pyx_v_eps) != 0);
    if (__pyx_t_15) {
    } else {
      __pyx_t_14 = __pyx_t_15;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_15 = ((__pyx_v_iter_count < __pyx_v_N) != 0);
    __pyx_t_14 = __pyx_t_15;
    __pyx_L7_bool_binop_done:;
    if (!__pyx_t_14) break;

    /* "pylsewave/cynum.pyx":3030
 *     iter_count = 0
 *     while fabs(norm) > eps and iter_count < N:
 *         bcs.conjuction_Jr(x, vessel_indices, J_value)             # <<<<<<<<<<<<<<
 *         cLUsolve(J_value, R_value, seq, delta)
 *         for i in range(n):
 */
    ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_bcs->__pyx_vtab)->conjuction_Jr(__pyx_v_bcs, __pyx_v_x, __pyx_v_vessel_indices, __pyx_v_J_value, 0);

    /* "pylsewave/cynum.pyx":3031
 *     while fabs(norm) > eps and iter_count < N:
 *         bcs.conjuction_Jr(x, vessel_indices, J_value)
 *         cLUsolve(J_value, R_value, seq, delta)             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             x[i] = x[i] + delta[i]
 */
    __pyx_f_9pylsewave_5cynum_cLUsolve(__pyx_v_J_value, __pyx_v_R_value, __pyx_v_seq, __pyx_v_delta);

    /* "pylsewave/cynum.pyx":3032
 *         bcs.conjuction_Jr(x, vessel_indices, J_value)
 *         cLUsolve(J_value, R_value, seq, delta)
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             x[i] = x[i] + delta[i]
 *         bcs.conjuction_R(x, u, dt, vessel_indices, R_value)
 */
    __pyx_t_6 = __pyx_v_n;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_6; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "pylsewave/cynum.pyx":3033
 *         cLUsolve(J_value, R_value, seq, delta)
 *         for i in range(n):
 *             x[i] = x[i] + delta[i]             # <<<<<<<<<<<<<<
 *         bcs.conjuction_R(x, u, dt, vessel_indices, R_value)
 *         norm = norm2(R_value)
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_18 = __pyx_v_i;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_18)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_16)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_delta.data) + __pyx_t_17)) ))));
    }

    /* "pylsewave/cynum.pyx":3034
 *         for i in range(n):
 *             x[i] = x[i] + delta[i]
 *         bcs.conjuction_R(x, u, dt, vessel_indices, R_value)             # <<<<<<<<<<<<<<
 *         norm = norm2(R_value)
 *         for i in range(n):
 */
    ((struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs *)__pyx_v_bcs->__pyx_vtab)->conjuction_R(__pyx_v_bcs, __pyx_v_x, __pyx_v_u, __pyx_v_dt, __pyx_v_vessel_indices, __pyx_v_R_value, 0);

    /* "pylsewave/cynum.pyx":3035
 *             x[i] = x[i] + delta[i]
 *         bcs.conjuction_R(x, u, dt, vessel_indices, R_value)
 *         norm = norm2(R_value)             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             R_value[i] = -R_value[i]
 */
    __pyx_v_norm = __pyx_f_9pylsewave_5cynum_norm2(__pyx_v_R_value, 0);

    /* "pylsewave/cynum.pyx":3036
 *         bcs.conjuction_R(x, u, dt, vessel_indices, R_value)
 *         norm = norm2(R_value)
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             R_value[i] = -R_value[i]
 *         iter_count += 1
 */
    __pyx_t_6 = __pyx_v_n;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_6; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "pylsewave/cynum.pyx":3037
 *         norm = norm2(R_value)
 *         for i in range(n):
 *             R_value[i] = -R_value[i]             # <<<<<<<<<<<<<<
 *         iter_count += 1
 *     if fabs(norm) > eps:
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_20 = __pyx_v_i;
      *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_R_value.data) + __pyx_t_20)) )) = (-(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_R_value.data) + __pyx_t_19)) ))));
    }

    /* "pylsewave/cynum.pyx":3038
 *         for i in range(n):
 *             R_value[i] = -R_value[i]
 *         iter_count += 1             # <<<<<<<<<<<<<<
 *     if fabs(norm) > eps:
 *         iter_count = -1
 */
    __pyx_v_iter_count = (__pyx_v_iter_count + 1);
  }

  /* "pylsewave/cynum.pyx":3039
 *             R_value[i] = -R_value[i]
 *         iter_count += 1
 *     if fabs(norm) > eps:             # <<<<<<<<<<<<<<
 *         iter_count = -1
 *     return iter_count
 */
  __pyx_t_14 = ((fabs(__pyx_v_norm) > __pyx_v_eps) != 0);
  if (__pyx_t_14) {

    /* "pylsewave/cynum.pyx":3040
 *         iter_count += 1
 *     if fabs(norm) > eps:
 *         iter_count = -1             # <<<<<<<<<<<<<<
 *     return iter_count
 * 
 */
    __pyx_v_iter_count = -1;

    /* "pylsewave/cynum.pyx":3039
 *             R_value[i] = -R_value[i]
 *         iter_count += 1
 *     if fabs(norm) > eps:             # <<<<<<<<<<<<<<
 *         iter_count = -1
 *     return iter_count
 */
  }

  /* "pylsewave/cynum.pyx":3041
 *     if fabs(norm) > eps:
 *         iter_count = -1
 *     return iter_count             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
  __pyx_r = __pyx_v_iter_count;
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":3003
 * @cython.wraparound(False)
 * @cython.cdivision(True)
 * cdef int Newton_Raphson_Sys_conj(cBCs bcs, double[::1] x, double[::1] u, double dt, int[::1] vessel_indices,             # <<<<<<<<<<<<<<
 *                                  double eps, int N=100):
 *     cdef Py_ssize_t n, siz, i
 */

  /* 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);
  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  __Pyx_WriteUnraisable("pylsewave.cynum.Newton_Raphson_Sys_conj", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_R_value, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_delta, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_J_value, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_seq, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pylsewave/cynum.pyx":3044
 * 
 * @cython.cdivision(True)
 * cpdef double linear_extrapolation(double x, double x1, double x2, double y1, double y2):             # <<<<<<<<<<<<<<
 *     return y1 + (x - x1)*((y2 - y1)/(x2-x1))
 */

static PyObject *__pyx_pw_9pylsewave_5cynum_13linear_extrapolation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_9pylsewave_5cynum_linear_extrapolation(double __pyx_v_x, double __pyx_v_x1, double __pyx_v_x2, double __pyx_v_y1, double __pyx_v_y2, CYTHON_UNUSED int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("linear_extrapolation", 0);

  /* "pylsewave/cynum.pyx":3045
 * @cython.cdivision(True)
 * cpdef double linear_extrapolation(double x, double x1, double x2, double y1, double y2):
 *     return y1 + (x - x1)*((y2 - y1)/(x2-x1))             # <<<<<<<<<<<<<<
 */
  __pyx_r = (__pyx_v_y1 + ((__pyx_v_x - __pyx_v_x1) * ((__pyx_v_y2 - __pyx_v_y1) / (__pyx_v_x2 - __pyx_v_x1))));
  goto __pyx_L0;

  /* "pylsewave/cynum.pyx":3044
 * 
 * @cython.cdivision(True)
 * cpdef double linear_extrapolation(double x, double x1, double x2, double y1, double y2):             # <<<<<<<<<<<<<<
 *     return y1 + (x - x1)*((y2 - y1)/(x2-x1))
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_9pylsewave_5cynum_13linear_extrapolation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_9pylsewave_5cynum_13linear_extrapolation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x;
  double __pyx_v_x1;
  double __pyx_v_x2;
  double __pyx_v_y1;
  double __pyx_v_y2;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("linear_extrapolation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_x1,&__pyx_n_s_x2,&__pyx_n_s_y1,&__pyx_n_s_y2,0};
    PyObject* values[5] = {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  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_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("linear_extrapolation", 1, 5, 5, 1); __PYX_ERR(0, 3044, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("linear_extrapolation", 1, 5, 5, 2); __PYX_ERR(0, 3044, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("linear_extrapolation", 1, 5, 5, 3); __PYX_ERR(0, 3044, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("linear_extrapolation", 1, 5, 5, 4); __PYX_ERR(0, 3044, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "linear_extrapolation") < 0)) __PYX_ERR(0, 3044, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3044, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3044, __pyx_L3_error)
    __pyx_v_x2 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3044, __pyx_L3_error)
    __pyx_v_y1 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_y1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3044, __pyx_L3_error)
    __pyx_v_y2 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_y2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3044, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("linear_extrapolation", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3044, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pylsewave.cynum.linear_extrapolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pylsewave_5cynum_12linear_extrapolation(__pyx_self, __pyx_v_x, __pyx_v_x1, __pyx_v_x2, __pyx_v_y1, __pyx_v_y2);

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

static PyObject *__pyx_pf_9pylsewave_5cynum_12linear_extrapolation(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x, double __pyx_v_x1, double __pyx_v_x2, double __pyx_v_y1, double __pyx_v_y2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("linear_extrapolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_9pylsewave_5cynum_linear_extrapolation(__pyx_v_x, __pyx_v_x1, __pyx_v_x2, __pyx_v_y1, __pyx_v_y2, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3044, __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("pylsewave.cynum.linear_extrapolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # 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;
  __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);
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":203
 *             # 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;
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":206
 * 
 *             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;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":207
 *             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);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":209
 *             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);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":211
 *             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) {

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":212
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":211
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
    goto __pyx_L4;
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":214
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
  /*else*/ {
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 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;
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  if (__pyx_t_1) {

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             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__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 218, __pyx_L1_error)

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 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")
 */
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 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;
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  if (__pyx_t_1) {

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             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__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 222, __pyx_L1_error)

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 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")
 */
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":224
 *                 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);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":225
 * 
 *             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;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":226
 *             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) {

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":229
 *                 # 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)));

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":230
 *                 # 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);

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":231
 *                 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;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":232
 *                 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]);

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":233
 *                 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]);
    }

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":226
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
    goto __pyx_L11;
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":235
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
  /*else*/ {
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":236
 *             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:;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":237
 *                 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;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":238
 *                 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);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":239
 *             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));

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":242
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef int offset
 */
  __pyx_v_f = NULL;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":243
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             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;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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) {

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":248
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
    goto __pyx_L14;
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":253
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
  /*else*/ {
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  }
  __pyx_L14:;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_1) {

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":256
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __pyx_t_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' 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:;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":258
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' 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:;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    if (__pyx_t_1) {

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":259
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' 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__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 259, __pyx_L1_error)

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":260
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    switch (__pyx_v_t) {
      case NPY_BYTE:
      __pyx_v_f = ((char *)"b");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"B");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"h");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"H");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"i");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"I");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"l");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"L");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"q");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"Q");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"f");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"d");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"g");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"Zf");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"Zd");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"Zg");
      break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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 = ((char *)"O");
      break;
      default:

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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_ERR(1, 278, __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_ERR(1, 278, __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_ERR(1, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __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_ERR(1, 278, __pyx_L1_error)
      break;
    }

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":282
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
  /*else*/ {
    __pyx_v_info->format = ((char *)malloc(0xFF));

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":283
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":284
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":285
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 */
    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error)
    __pyx_v_f = __pyx_t_7;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":288
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = '\x00';
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # 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;
}

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *                 f[0] = c'\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);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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) {

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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);

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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):
 */
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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) {

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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);

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.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
 */
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

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

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":770
 * 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;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":771
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":770
 * 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;
}

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":773
 *     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;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":774
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":773
 *     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;
}

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":776
 *     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;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":777
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":776
 *     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;
}

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":779
 *     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;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":780
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":779
 *     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;
}

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":782
 *     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;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":783
 * 
 * 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_ERR(1, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":782
 *     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;
}

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":785
 *     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;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  char *__pyx_t_9;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":790
 * 
 *     cdef dtype child
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":791
 *     cdef dtype child
 *     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);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     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_ERR(1, 794, __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_ERR(1, 794, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":795
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    if (unlikely(__pyx_v_descr->fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 795, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __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_ERR(1, 795, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":796
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - <int>(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_ERR(1, 796, __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_ERR(1, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error)
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __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;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
    if (__pyx_t_6) {

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":799
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 799, __pyx_L1_error)

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    }

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' 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:;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":802
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' 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:;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    if (__pyx_t_6) {

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' 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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 803, __pyx_L1_error)

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":813
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_6) break;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":814
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 0x78;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":815
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":816
 *             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);
    }

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":818
 *             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);

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":820
 *         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) {

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":821
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":822
 *         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) {

        /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":823
 *             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_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(1, 823, __pyx_L1_error)

        /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":826
 * 
 *             # 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_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":827
 *             # 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_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":828
 *             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_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x68;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":829
 *             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_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":830
 *             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_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x69;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":831
 *             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_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":832
 *             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_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x6C;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":833
 *             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_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":834
 *             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_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x71;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":835
 *             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_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":836
 *             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_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x66;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":837
 *             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_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x64;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":838
 *             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_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x67;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":839
 *             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_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x66;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":840
 *             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_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __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]) = 0x64;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":841
 *             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_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x67;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":842
 *             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_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L15;
      }

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":844
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
      /*else*/ {
        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(1, 844, __pyx_L1_error)
      }
      __pyx_L15:;

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":845
 *             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);

      /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
      goto __pyx_L13;
    }

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":849
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
    /*else*/ {
      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error)
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     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;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":850
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":785
 *     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_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;
}

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":966
 * 
 * 
 * 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);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":968
 * 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) {

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":969
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":968
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
    goto __pyx_L3;
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":971
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
  /*else*/ {
    Py_INCREF(__pyx_v_base);

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":972
 *      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:;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":973
 *          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);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":974
 *          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;

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":966
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

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

/* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *      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);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":977
 * 
 * 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) {

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":978
 * 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;

    /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":980
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *      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;
}

/* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length
 *     cdef char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  Py_ssize_t __pyx_v_length;
  char *__pyx_v_data;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length
 *     cdef char* data = __Pyx_PyObject_AsStringAndSize(o, &length)             # <<<<<<<<<<<<<<
 *     return string(data, length)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 15, __pyx_L1_error)
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length
 *     cdef char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  goto __pyx_L0;

  /* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length
 *     cdef char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "FromPyStructUtility":11
 * 
 * @cname("__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel")
 * cdef cvessel __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef cvessel result
 *     if not PyMapping_Check(obj):
 */

static struct __pyx_t_9pylsewave_5cynum_cvessel __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(PyObject *__pyx_v_obj) {
  struct __pyx_t_9pylsewave_5cynum_cvessel __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  struct __pyx_t_9pylsewave_5cynum_cvessel __pyx_r;
  __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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_t_11;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", 0);

  /* "FromPyStructUtility":13
 * cdef cvessel __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(obj) except *:
 *     cdef cvessel result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":14
 *     cdef cvessel result
 *     if not PyMapping_Check(obj):
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = PyErr_Format(__pyx_builtin_TypeError, ((char const *)"Expected %.16s, got %.200s"), ((char *)"a mapping"), Py_TYPE(__pyx_v_obj)->tp_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":13
 * cdef cvessel __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(obj) except *:
 *     cdef cvessel result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 */
  }

  /* "FromPyStructUtility":16
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['r0']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":17
 * 
 *     try:
 *         value = obj['r0']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'r0'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_r0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_value = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":16
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['r0']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L11_try_end;
    __pyx_L4_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":18
 *     try:
 *         value = obj['r0']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'r0'")
 *     result.r0 = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 18, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":19
 *         value = obj['r0']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'r0'")             # <<<<<<<<<<<<<<
 *     result.r0 = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 19, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":16
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['r0']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L11_try_end:;
  }

  /* "FromPyStructUtility":20
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'r0'")
 *     result.r0 = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['f_r0']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 20, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.r0, 0);
  __pyx_v_result.r0 = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":21
 *         raise ValueError("No value specified for struct attribute 'r0'")
 *     result.r0 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['f_r0']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":22
 *     result.r0 = value
 *     try:
 *         value = obj['f_r0']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_f_r0); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 22, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":21
 *         raise ValueError("No value specified for struct attribute 'r0'")
 *     result.r0 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['f_r0']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L21_try_end;
    __pyx_L14_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":23
 *     try:
 *         value = obj['f_r0']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'f_r0'")
 *     result.f_r0 = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 23, __pyx_L16_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":24
 *         value = obj['f_r0']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0'")             # <<<<<<<<<<<<<<
 *     result.f_r0 = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 24, __pyx_L16_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 24, __pyx_L16_except_error)
    }
    goto __pyx_L16_except_error;
    __pyx_L16_except_error:;

    /* "FromPyStructUtility":21
 *         raise ValueError("No value specified for struct attribute 'r0'")
 *     result.r0 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['f_r0']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L21_try_end:;
  }

  /* "FromPyStructUtility":25
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0'")
 *     result.f_r0 = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['interpolate_R0p']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 25, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.f_r0, 0);
  __pyx_v_result.f_r0 = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":26
 *         raise ValueError("No value specified for struct attribute 'f_r0'")
 *     result.f_r0 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['interpolate_R0p']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":27
 *     result.f_r0 = value
 *     try:
 *         value = obj['interpolate_R0p']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0p'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_interpolate_R0p); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 27, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":26
 *         raise ValueError("No value specified for struct attribute 'f_r0'")
 *     result.f_r0 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['interpolate_R0p']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L31_try_end;
    __pyx_L24_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":28
 *     try:
 *         value = obj['interpolate_R0p']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0p'")
 *     result.interpolate_R0p = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 28, __pyx_L26_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":29
 *         value = obj['interpolate_R0p']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0p'")             # <<<<<<<<<<<<<<
 *     result.interpolate_R0p = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 29, __pyx_L26_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 29, __pyx_L26_except_error)
    }
    goto __pyx_L26_except_error;
    __pyx_L26_except_error:;

    /* "FromPyStructUtility":26
 *         raise ValueError("No value specified for struct attribute 'f_r0'")
 *     result.f_r0 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['interpolate_R0p']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L31_try_end:;
  }

  /* "FromPyStructUtility":30
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0p'")
 *     result.interpolate_R0p = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['interpolate_R0m']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 30, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.interpolate_R0p, 0);
  __pyx_v_result.interpolate_R0p = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":31
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0p'")
 *     result.interpolate_R0p = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['interpolate_R0m']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":32
 *     result.interpolate_R0p = value
 *     try:
 *         value = obj['interpolate_R0m']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0m'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_interpolate_R0m); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 32, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":31
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0p'")
 *     result.interpolate_R0p = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['interpolate_R0m']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L41_try_end;
    __pyx_L34_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":33
 *     try:
 *         value = obj['interpolate_R0m']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0m'")
 *     result.interpolate_R0m = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 33, __pyx_L36_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":34
 *         value = obj['interpolate_R0m']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0m'")             # <<<<<<<<<<<<<<
 *     result.interpolate_R0m = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 34, __pyx_L36_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 34, __pyx_L36_except_error)
    }
    goto __pyx_L36_except_error;
    __pyx_L36_except_error:;

    /* "FromPyStructUtility":31
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0p'")
 *     result.interpolate_R0p = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['interpolate_R0m']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L41_try_end:;
  }

  /* "FromPyStructUtility":35
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0m'")
 *     result.interpolate_R0m = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['f_r0_ph']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 35, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.interpolate_R0m, 0);
  __pyx_v_result.interpolate_R0m = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":36
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0m'")
 *     result.interpolate_R0m = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['f_r0_ph']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":37
 *     result.interpolate_R0m = value
 *     try:
 *         value = obj['f_r0_ph']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0_ph'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_f_r0_ph); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 37, __pyx_L44_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":36
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0m'")
 *     result.interpolate_R0m = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['f_r0_ph']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L51_try_end;
    __pyx_L44_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":38
 *     try:
 *         value = obj['f_r0_ph']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'f_r0_ph'")
 *     result.f_r0_ph = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 38, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":39
 *         value = obj['f_r0_ph']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0_ph'")             # <<<<<<<<<<<<<<
 *     result.f_r0_ph = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 39, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 39, __pyx_L46_except_error)
    }
    goto __pyx_L46_except_error;
    __pyx_L46_except_error:;

    /* "FromPyStructUtility":36
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0m'")
 *     result.interpolate_R0m = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['f_r0_ph']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L51_try_end:;
  }

  /* "FromPyStructUtility":40
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0_ph'")
 *     result.f_r0_ph = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['f_r0_mh']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 40, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.f_r0_ph, 0);
  __pyx_v_result.f_r0_ph = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":41
 *         raise ValueError("No value specified for struct attribute 'f_r0_ph'")
 *     result.f_r0_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['f_r0_mh']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":42
 *     result.f_r0_ph = value
 *     try:
 *         value = obj['f_r0_mh']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0_mh'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_f_r0_mh); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 42, __pyx_L54_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":41
 *         raise ValueError("No value specified for struct attribute 'f_r0_ph'")
 *     result.f_r0_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['f_r0_mh']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L61_try_end;
    __pyx_L54_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":43
 *     try:
 *         value = obj['f_r0_mh']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'f_r0_mh'")
 *     result.f_r0_mh = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 43, __pyx_L56_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":44
 *         value = obj['f_r0_mh']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0_mh'")             # <<<<<<<<<<<<<<
 *     result.f_r0_mh = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 44, __pyx_L56_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 44, __pyx_L56_except_error)
    }
    goto __pyx_L56_except_error;
    __pyx_L56_except_error:;

    /* "FromPyStructUtility":41
 *         raise ValueError("No value specified for struct attribute 'f_r0_ph'")
 *     result.f_r0_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['f_r0_mh']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L61_try_end:;
  }

  /* "FromPyStructUtility":45
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0_mh'")
 *     result.f_r0_mh = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['df_dr0']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 45, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.f_r0_mh, 0);
  __pyx_v_result.f_r0_mh = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":46
 *         raise ValueError("No value specified for struct attribute 'f_r0_mh'")
 *     result.f_r0_mh = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dr0']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":47
 *     result.f_r0_mh = value
 *     try:
 *         value = obj['df_dr0']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_df_dr0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 47, __pyx_L64_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":46
 *         raise ValueError("No value specified for struct attribute 'f_r0_mh'")
 *     result.f_r0_mh = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dr0']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L71_try_end;
    __pyx_L64_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":48
 *     try:
 *         value = obj['df_dr0']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'df_dr0'")
 *     result.df_dr0 = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 48, __pyx_L66_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":49
 *         value = obj['df_dr0']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0'")             # <<<<<<<<<<<<<<
 *     result.df_dr0 = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 49, __pyx_L66_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 49, __pyx_L66_except_error)
    }
    goto __pyx_L66_except_error;
    __pyx_L66_except_error:;

    /* "FromPyStructUtility":46
 *         raise ValueError("No value specified for struct attribute 'f_r0_mh'")
 *     result.f_r0_mh = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dr0']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L71_try_end:;
  }

  /* "FromPyStructUtility":50
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0'")
 *     result.df_dr0 = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['df_dx']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 50, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.df_dr0, 0);
  __pyx_v_result.df_dr0 = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":51
 *         raise ValueError("No value specified for struct attribute 'df_dr0'")
 *     result.df_dr0 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dx']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":52
 *     result.df_dr0 = value
 *     try:
 *         value = obj['df_dx']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_df_dx); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 52, __pyx_L74_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":51
 *         raise ValueError("No value specified for struct attribute 'df_dr0'")
 *     result.df_dr0 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dx']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L81_try_end;
    __pyx_L74_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":53
 *     try:
 *         value = obj['df_dx']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'df_dx'")
 *     result.df_dx = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 53, __pyx_L76_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":54
 *         value = obj['df_dx']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx'")             # <<<<<<<<<<<<<<
 *     result.df_dx = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 54, __pyx_L76_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 54, __pyx_L76_except_error)
    }
    goto __pyx_L76_except_error;
    __pyx_L76_except_error:;

    /* "FromPyStructUtility":51
 *         raise ValueError("No value specified for struct attribute 'df_dr0'")
 *     result.df_dr0 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dx']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L81_try_end:;
  }

  /* "FromPyStructUtility":55
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx'")
 *     result.df_dx = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['df_dr0_ph']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 55, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.df_dx, 0);
  __pyx_v_result.df_dx = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":56
 *         raise ValueError("No value specified for struct attribute 'df_dx'")
 *     result.df_dx = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dr0_ph']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":57
 *     result.df_dx = value
 *     try:
 *         value = obj['df_dr0_ph']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0_ph'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_df_dr0_ph); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 57, __pyx_L84_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":56
 *         raise ValueError("No value specified for struct attribute 'df_dx'")
 *     result.df_dx = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dr0_ph']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L91_try_end;
    __pyx_L84_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":58
 *     try:
 *         value = obj['df_dr0_ph']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'df_dr0_ph'")
 *     result.df_dr0_ph = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 58, __pyx_L86_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":59
 *         value = obj['df_dr0_ph']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0_ph'")             # <<<<<<<<<<<<<<
 *     result.df_dr0_ph = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 59, __pyx_L86_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 59, __pyx_L86_except_error)
    }
    goto __pyx_L86_except_error;
    __pyx_L86_except_error:;

    /* "FromPyStructUtility":56
 *         raise ValueError("No value specified for struct attribute 'df_dx'")
 *     result.df_dx = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dr0_ph']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L91_try_end:;
  }

  /* "FromPyStructUtility":60
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0_ph'")
 *     result.df_dr0_ph = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['df_dx_ph']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 60, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.df_dr0_ph, 0);
  __pyx_v_result.df_dr0_ph = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":61
 *         raise ValueError("No value specified for struct attribute 'df_dr0_ph'")
 *     result.df_dr0_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dx_ph']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":62
 *     result.df_dr0_ph = value
 *     try:
 *         value = obj['df_dx_ph']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx_ph'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_df_dx_ph); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 62, __pyx_L94_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":61
 *         raise ValueError("No value specified for struct attribute 'df_dr0_ph'")
 *     result.df_dr0_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dx_ph']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L101_try_end;
    __pyx_L94_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":63
 *     try:
 *         value = obj['df_dx_ph']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'df_dx_ph'")
 *     result.df_dx_ph = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 63, __pyx_L96_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":64
 *         value = obj['df_dx_ph']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx_ph'")             # <<<<<<<<<<<<<<
 *     result.df_dx_ph = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 64, __pyx_L96_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 64, __pyx_L96_except_error)
    }
    goto __pyx_L96_except_error;
    __pyx_L96_except_error:;

    /* "FromPyStructUtility":61
 *         raise ValueError("No value specified for struct attribute 'df_dr0_ph'")
 *     result.df_dr0_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dx_ph']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L101_try_end:;
  }

  /* "FromPyStructUtility":65
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx_ph'")
 *     result.df_dx_ph = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['df_dr0_mh']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 65, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.df_dx_ph, 0);
  __pyx_v_result.df_dx_ph = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":66
 *         raise ValueError("No value specified for struct attribute 'df_dx_ph'")
 *     result.df_dx_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dr0_mh']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":67
 *     result.df_dx_ph = value
 *     try:
 *         value = obj['df_dr0_mh']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0_mh'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_df_dr0_mh); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 67, __pyx_L104_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":66
 *         raise ValueError("No value specified for struct attribute 'df_dx_ph'")
 *     result.df_dx_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dr0_mh']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L111_try_end;
    __pyx_L104_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":68
 *     try:
 *         value = obj['df_dr0_mh']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'df_dr0_mh'")
 *     result.df_dr0_mh = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 68, __pyx_L106_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":69
 *         value = obj['df_dr0_mh']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0_mh'")             # <<<<<<<<<<<<<<
 *     result.df_dr0_mh = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 69, __pyx_L106_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 69, __pyx_L106_except_error)
    }
    goto __pyx_L106_except_error;
    __pyx_L106_except_error:;

    /* "FromPyStructUtility":66
 *         raise ValueError("No value specified for struct attribute 'df_dx_ph'")
 *     result.df_dx_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dr0_mh']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L111_try_end:;
  }

  /* "FromPyStructUtility":70
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0_mh'")
 *     result.df_dr0_mh = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['df_dx_mh']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 70, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.df_dr0_mh, 0);
  __pyx_v_result.df_dr0_mh = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":71
 *         raise ValueError("No value specified for struct attribute 'df_dr0_mh'")
 *     result.df_dr0_mh = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dx_mh']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":72
 *     result.df_dr0_mh = value
 *     try:
 *         value = obj['df_dx_mh']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx_mh'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_df_dx_mh); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 72, __pyx_L114_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":71
 *         raise ValueError("No value specified for struct attribute 'df_dr0_mh'")
 *     result.df_dr0_mh = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dx_mh']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L121_try_end;
    __pyx_L114_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":73
 *     try:
 *         value = obj['df_dx_mh']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'df_dx_mh'")
 *     result.df_dx_mh = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 73, __pyx_L116_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":74
 *         value = obj['df_dx_mh']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx_mh'")             # <<<<<<<<<<<<<<
 *     result.df_dx_mh = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 74, __pyx_L116_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 74, __pyx_L116_except_error)
    }
    goto __pyx_L116_except_error;
    __pyx_L116_except_error:;

    /* "FromPyStructUtility":71
 *         raise ValueError("No value specified for struct attribute 'df_dr0_mh'")
 *     result.df_dr0_mh = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['df_dx_mh']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L121_try_end:;
  }

  /* "FromPyStructUtility":75
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx_mh'")
 *     result.df_dx_mh = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['L']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 75, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.df_dx_mh, 0);
  __pyx_v_result.df_dx_mh = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":76
 *         raise ValueError("No value specified for struct attribute 'df_dx_mh'")
 *     result.df_dx_mh = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['L']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":77
 *     result.df_dx_mh = value
 *     try:
 *         value = obj['L']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'L'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_L); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 77, __pyx_L124_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":76
 *         raise ValueError("No value specified for struct attribute 'df_dx_mh'")
 *     result.df_dx_mh = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['L']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L131_try_end;
    __pyx_L124_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":78
 *     try:
 *         value = obj['L']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'L'")
 *     result.L = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 78, __pyx_L126_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":79
 *         value = obj['L']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'L'")             # <<<<<<<<<<<<<<
 *     result.L = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 79, __pyx_L126_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 79, __pyx_L126_except_error)
    }
    goto __pyx_L126_except_error;
    __pyx_L126_except_error:;

    /* "FromPyStructUtility":76
 *         raise ValueError("No value specified for struct attribute 'df_dx_mh'")
 *     result.df_dx_mh = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['L']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L131_try_end:;
  }

  /* "FromPyStructUtility":80
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'L'")
 *     result.L = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['dx']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 80, __pyx_L1_error)
  __pyx_v_result.L = __pyx_t_11;

  /* "FromPyStructUtility":81
 *         raise ValueError("No value specified for struct attribute 'L'")
 *     result.L = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['dx']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":82
 *     result.L = value
 *     try:
 *         value = obj['dx']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'dx'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_dx); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 82, __pyx_L134_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":81
 *         raise ValueError("No value specified for struct attribute 'L'")
 *     result.L = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['dx']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L141_try_end;
    __pyx_L134_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":83
 *     try:
 *         value = obj['dx']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'dx'")
 *     result.dx = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 83, __pyx_L136_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":84
 *         value = obj['dx']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'dx'")             # <<<<<<<<<<<<<<
 *     result.dx = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 84, __pyx_L136_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 84, __pyx_L136_except_error)
    }
    goto __pyx_L136_except_error;
    __pyx_L136_except_error:;

    /* "FromPyStructUtility":81
 *         raise ValueError("No value specified for struct attribute 'L'")
 *     result.L = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['dx']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L141_try_end:;
  }

  /* "FromPyStructUtility":85
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'dx'")
 *     result.dx = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['phi']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 85, __pyx_L1_error)
  __pyx_v_result.dx = __pyx_t_11;

  /* "FromPyStructUtility":86
 *         raise ValueError("No value specified for struct attribute 'dx'")
 *     result.dx = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['phi']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":87
 *     result.dx = value
 *     try:
 *         value = obj['phi']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'phi'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_phi); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 87, __pyx_L144_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":86
 *         raise ValueError("No value specified for struct attribute 'dx'")
 *     result.dx = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['phi']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L151_try_end;
    __pyx_L144_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":88
 *     try:
 *         value = obj['phi']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'phi'")
 *     result.phi = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 88, __pyx_L146_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":89
 *         value = obj['phi']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'phi'")             # <<<<<<<<<<<<<<
 *     result.phi = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 89, __pyx_L146_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 89, __pyx_L146_except_error)
    }
    goto __pyx_L146_except_error;
    __pyx_L146_except_error:;

    /* "FromPyStructUtility":86
 *         raise ValueError("No value specified for struct attribute 'dx'")
 *     result.dx = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['phi']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L151_try_end:;
  }

  /* "FromPyStructUtility":90
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'phi'")
 *     result.phi = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['RLC']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 90, __pyx_L1_error)
  __pyx_v_result.phi = __pyx_t_11;

  /* "FromPyStructUtility":91
 *         raise ValueError("No value specified for struct attribute 'phi'")
 *     result.phi = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['RLC']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":92
 *     result.phi = value
 *     try:
 *         value = obj['RLC']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'RLC'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_RLC); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 92, __pyx_L154_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":91
 *         raise ValueError("No value specified for struct attribute 'phi'")
 *     result.phi = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['RLC']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L161_try_end;
    __pyx_L154_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":93
 *     try:
 *         value = obj['RLC']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'RLC'")
 *     result.RLC = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 93, __pyx_L156_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":94
 *         value = obj['RLC']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'RLC'")             # <<<<<<<<<<<<<<
 *     result.RLC = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 94, __pyx_L156_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 94, __pyx_L156_except_error)
    }
    goto __pyx_L156_except_error;
    __pyx_L156_except_error:;

    /* "FromPyStructUtility":91
 *         raise ValueError("No value specified for struct attribute 'phi'")
 *     result.phi = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['RLC']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L161_try_end:;
  }

  /* "FromPyStructUtility":95
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'RLC'")
 *     result.RLC = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 95, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.RLC, 0);
  __pyx_v_result.RLC = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":96
 *         raise ValueError("No value specified for struct attribute 'RLC'")
 *     result.RLC = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":11
 * 
 * @cname("__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel")
 * cdef cvessel __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef cvessel result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.from_py":50
 * 
 * @cname("__pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel")
 * cdef vector[X] __pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

static std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(PyObject *__pyx_v_o) {
  std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_v_v;
  PyObject *__pyx_v_item = NULL;
  std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_t_9pylsewave_5cynum_cvessel __pyx_t_5;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", 0);

  /* "vector.from_py":52
 * cdef vector[X] __pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(X_from_py(item))
 *     return v
 */
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 52, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 52, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 52, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 52, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 52, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 52, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "vector.from_py":53
 *     cdef vector[X] v
 *     for item in o:
 *         v.push_back(X_from_py(item))             # <<<<<<<<<<<<<<
 *     return v
 * 
 */
    __pyx_t_5 = __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 53, __pyx_L1_error)
    __pyx_v_v.push_back(__pyx_t_5);

    /* "vector.from_py":52
 * cdef vector[X] __pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(X_from_py(item))
 *     return v
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.from_py":54
 *     for item in o:
 *         v.push_back(X_from_py(item))
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":50
 * 
 * @cname("__pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel")
 * cdef vector[X] __pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "FromPyStructUtility":11
 * 
 * @cname("__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj")
 * cdef cParabolicSolObj __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef cParabolicSolObj result
 *     if not PyMapping_Check(obj):
 */

static struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj(PyObject *__pyx_v_obj) {
  struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj __pyx_r;
  __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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj", 0);

  /* "FromPyStructUtility":13
 * cdef cParabolicSolObj __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj(obj) except *:
 *     cdef cParabolicSolObj result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":14
 *     cdef cParabolicSolObj result
 *     if not PyMapping_Check(obj):
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = PyErr_Format(__pyx_builtin_TypeError, ((char const *)"Expected %.16s, got %.200s"), ((char *)"a mapping"), Py_TYPE(__pyx_v_obj)->tp_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":13
 * cdef cParabolicSolObj __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj(obj) except *:
 *     cdef cParabolicSolObj result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 */
  }

  /* "FromPyStructUtility":16
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['x_hyper']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":17
 * 
 *     try:
 *         value = obj['x_hyper']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'x_hyper'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_x_hyper); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_value = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":16
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['x_hyper']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L11_try_end;
    __pyx_L4_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":18
 *     try:
 *         value = obj['x_hyper']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'x_hyper'")
 *     result.x_hyper = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 18, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":19
 *         value = obj['x_hyper']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'x_hyper'")             # <<<<<<<<<<<<<<
 *     result.x_hyper = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 19, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":16
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['x_hyper']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L11_try_end:;
  }

  /* "FromPyStructUtility":20
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'x_hyper'")
 *     result.x_hyper = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['a']
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(2, 20, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.x_hyper, 0);
  __pyx_v_result.x_hyper = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "FromPyStructUtility":21
 *         raise ValueError("No value specified for struct attribute 'x_hyper'")
 *     result.x_hyper = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['a']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":22
 *     result.x_hyper = value
 *     try:
 *         value = obj['a']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_a); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 22, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":21
 *         raise ValueError("No value specified for struct attribute 'x_hyper'")
 *     result.x_hyper = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['a']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L21_try_end;
    __pyx_L14_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":23
 *     try:
 *         value = obj['a']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'a'")
 *     result.a = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 23, __pyx_L16_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":24
 *         value = obj['a']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a'")             # <<<<<<<<<<<<<<
 *     result.a = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 24, __pyx_L16_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 24, __pyx_L16_except_error)
    }
    goto __pyx_L16_except_error;
    __pyx_L16_except_error:;

    /* "FromPyStructUtility":21
 *         raise ValueError("No value specified for struct attribute 'x_hyper'")
 *     result.x_hyper = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['a']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L21_try_end:;
  }

  /* "FromPyStructUtility":25
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a'")
 *     result.a = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['b']
 */
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(2, 25, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.a, 0);
  __pyx_v_result.a = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "FromPyStructUtility":26
 *         raise ValueError("No value specified for struct attribute 'a'")
 *     result.a = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['b']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":27
 *     result.a = value
 *     try:
 *         value = obj['b']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'b'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 27, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":26
 *         raise ValueError("No value specified for struct attribute 'a'")
 *     result.a = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['b']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L31_try_end;
    __pyx_L24_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":28
 *     try:
 *         value = obj['b']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'b'")
 *     result.b = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 28, __pyx_L26_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":29
 *         value = obj['b']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'b'")             # <<<<<<<<<<<<<<
 *     result.b = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 29, __pyx_L26_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 29, __pyx_L26_except_error)
    }
    goto __pyx_L26_except_error;
    __pyx_L26_except_error:;

    /* "FromPyStructUtility":26
 *         raise ValueError("No value specified for struct attribute 'a'")
 *     result.a = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['b']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L31_try_end:;
  }

  /* "FromPyStructUtility":30
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'b'")
 *     result.b = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['c']
 */
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(2, 30, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.b, 0);
  __pyx_v_result.b = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "FromPyStructUtility":31
 *         raise ValueError("No value specified for struct attribute 'b'")
 *     result.b = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['c']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":32
 *     result.b = value
 *     try:
 *         value = obj['c']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'c'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_c); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 32, __pyx_L34_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":31
 *         raise ValueError("No value specified for struct attribute 'b'")
 *     result.b = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['c']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L41_try_end;
    __pyx_L34_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":33
 *     try:
 *         value = obj['c']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'c'")
 *     result.c = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 33, __pyx_L36_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":34
 *         value = obj['c']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'c'")             # <<<<<<<<<<<<<<
 *     result.c = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 34, __pyx_L36_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 34, __pyx_L36_except_error)
    }
    goto __pyx_L36_except_error;
    __pyx_L36_except_error:;

    /* "FromPyStructUtility":31
 *         raise ValueError("No value specified for struct attribute 'b'")
 *     result.b = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['c']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L41_try_end:;
  }

  /* "FromPyStructUtility":35
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'c'")
 *     result.c = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['d']
 */
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(2, 35, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.c, 0);
  __pyx_v_result.c = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "FromPyStructUtility":36
 *         raise ValueError("No value specified for struct attribute 'c'")
 *     result.c = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['d']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":37
 *     result.c = value
 *     try:
 *         value = obj['d']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'd'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 37, __pyx_L44_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":36
 *         raise ValueError("No value specified for struct attribute 'c'")
 *     result.c = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['d']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L51_try_end;
    __pyx_L44_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":38
 *     try:
 *         value = obj['d']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'd'")
 *     result.d = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 38, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":39
 *         value = obj['d']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'd'")             # <<<<<<<<<<<<<<
 *     result.d = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 39, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 39, __pyx_L46_except_error)
    }
    goto __pyx_L46_except_error;
    __pyx_L46_except_error:;

    /* "FromPyStructUtility":36
 *         raise ValueError("No value specified for struct attribute 'c'")
 *     result.c = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['d']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L51_try_end:;
  }

  /* "FromPyStructUtility":40
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'd'")
 *     result.d = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['a_ph']
 */
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(2, 40, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.d, 0);
  __pyx_v_result.d = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "FromPyStructUtility":41
 *         raise ValueError("No value specified for struct attribute 'd'")
 *     result.d = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['a_ph']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":42
 *     result.d = value
 *     try:
 *         value = obj['a_ph']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a_ph'")
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_a_ph); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 42, __pyx_L54_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":41
 *         raise ValueError("No value specified for struct attribute 'd'")
 *     result.d = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['a_ph']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L61_try_end;
    __pyx_L54_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":43
 *     try:
 *         value = obj['a_ph']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'a_ph'")
 *     result.a_ph = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 43, __pyx_L56_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":44
 *         value = obj['a_ph']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a_ph'")             # <<<<<<<<<<<<<<
 *     result.a_ph = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 44, __pyx_L56_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 44, __pyx_L56_except_error)
    }
    goto __pyx_L56_except_error;
    __pyx_L56_except_error:;

    /* "FromPyStructUtility":41
 *         raise ValueError("No value specified for struct attribute 'd'")
 *     result.d = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['a_ph']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L61_try_end:;
  }

  /* "FromPyStructUtility":45
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a_ph'")
 *     result.a_ph = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['a_mh']
 */
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(2, 45, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.a_ph, 0);
  __pyx_v_result.a_ph = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "FromPyStructUtility":46
 *         raise ValueError("No value specified for struct attribute 'a_ph'")
 *     result.a_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['a_mh']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":47
 *     result.a_ph = value
 *     try:
 *         value = obj['a_mh']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a_mh'")
 */
      __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_a_mh); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 47, __pyx_L64_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":46
 *         raise ValueError("No value specified for struct attribute 'a_ph'")
 *     result.a_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['a_mh']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L71_try_end;
    __pyx_L64_error:;
    __Pyx_PyThreadState_assign
    __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
    __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":48
 *     try:
 *         value = obj['a_mh']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'a_mh'")
 *     result.a_mh = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 48, __pyx_L66_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":49
 *         value = obj['a_mh']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a_mh'")             # <<<<<<<<<<<<<<
 *     result.a_mh = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 49, __pyx_L66_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 49, __pyx_L66_except_error)
    }
    goto __pyx_L66_except_error;
    __pyx_L66_except_error:;

    /* "FromPyStructUtility":46
 *         raise ValueError("No value specified for struct attribute 'a_ph'")
 *     result.a_ph = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['a_mh']
 *     except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L71_try_end:;
  }

  /* "FromPyStructUtility":50
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a_mh'")
 *     result.a_mh = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_value);
  if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(2, 50, __pyx_L1_error)
  __PYX_XDEC_MEMVIEW(&__pyx_v_result.a_mh, 0);
  __pyx_v_result.a_mh = __pyx_t_11;
  __pyx_t_11.memview = NULL;
  __pyx_t_11.data = NULL;

  /* "FromPyStructUtility":51
 *         raise ValueError("No value specified for struct attribute 'a_mh'")
 *     result.a_mh = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":11
 * 
 * @cname("__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj")
 * cdef cParabolicSolObj __pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef cParabolicSolObj result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "map.from_py":197
 * 
 * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_double")
 * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_double(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef dict d = o
 *     cdef map[X,Y] m
 */

static std::map<std::string,double>  __pyx_convert_map_from_py_std_3a__3a_string__and_double(PyObject *__pyx_v_o) {
  PyObject *__pyx_v_d = 0;
  std::map<std::string,double>  __pyx_v_m;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  std::map<std::string,double>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  std::string __pyx_t_8;
  double __pyx_t_9;
  __Pyx_RefNannySetupContext("__pyx_convert_map_from_py_std_3a__3a_string__and_double", 0);

  /* "map.from_py":198
 * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_double")
 * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_double(object o) except *:
 *     cdef dict d = o             # <<<<<<<<<<<<<<
 *     cdef map[X,Y] m
 *     for key, value in d.iteritems():
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_o))||((__pyx_v_o) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_o)->tp_name), 0))) __PYX_ERR(2, 198, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_o;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_d = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "map.from_py":200
 *     cdef dict d = o
 *     cdef map[X,Y] m
 *     for key, value in d.iteritems():             # <<<<<<<<<<<<<<
 *         m.insert(pair[X,Y](X_from_py(key), Y_from_py(value)))
 *     return m
 */
  __pyx_t_2 = 0;
  if (unlikely(__pyx_v_d == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
    __PYX_ERR(2, 200, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_d, 1, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(2, 200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "map.from_py":201
 *     cdef map[X,Y] m
 *     for key, value in d.iteritems():
 *         m.insert(pair[X,Y](X_from_py(key), Y_from_py(value)))             # <<<<<<<<<<<<<<
 *     return m
 * 
 */
    __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 201, __pyx_L1_error)
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_9 == -1.0 && PyErr_Occurred())) __PYX_ERR(2, 201, __pyx_L1_error)
    __pyx_v_m.insert(std::pair<std::string,double> (__pyx_t_8, __pyx_t_9));
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "map.from_py":202
 *     for key, value in d.iteritems():
 *         m.insert(pair[X,Y](X_from_py(key), Y_from_py(value)))
 *     return m             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_m;
  goto __pyx_L0;

  /* "map.from_py":197
 * 
 * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_double")
 * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_double(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef dict d = o
 *     cdef map[X,Y] m
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("map.from_py.__pyx_convert_map_from_py_std_3a__3a_string__and_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":31
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);

  /* "string.to_py":32
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":31
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":37
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);

  /* "string.to_py":38
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyStr_FromStringAndSize(char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":37
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":43
 * 
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);

  /* "string.to_py":44
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyBytes_FromStringAndSize(char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":43
 * 
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":49
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);

  /* "string.to_py":50
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":49
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);

  /* "string.to_py":56
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "map.to_py":227
 * 
 * @cname("__pyx_convert_map_to_py_std_3a__3a_string____double")
 * cdef object __pyx_convert_map_to_py_std_3a__3a_string____double(const map[X,Y]& s):             # <<<<<<<<<<<<<<
 *     o = {}
 *     cdef const map[X,Y].value_type *key_value
 */

static PyObject *__pyx_convert_map_to_py_std_3a__3a_string____double(std::map<std::string,double>  const &__pyx_v_s) {
  PyObject *__pyx_v_o = NULL;
  std::map<std::string,double> ::value_type const *__pyx_v_key_value;
  std::map<std::string,double> ::const_iterator __pyx_v_iter;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_map_to_py_std_3a__3a_string____double", 0);

  /* "map.to_py":228
 * @cname("__pyx_convert_map_to_py_std_3a__3a_string____double")
 * cdef object __pyx_convert_map_to_py_std_3a__3a_string____double(const map[X,Y]& s):
 *     o = {}             # <<<<<<<<<<<<<<
 *     cdef const map[X,Y].value_type *key_value
 *     cdef map[X,Y].const_iterator iter = s.begin()
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_o = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "map.to_py":230
 *     o = {}
 *     cdef const map[X,Y].value_type *key_value
 *     cdef map[X,Y].const_iterator iter = s.begin()             # <<<<<<<<<<<<<<
 *     while iter != s.end():
 *         key_value = &cython.operator.dereference(iter)
 */
  __pyx_v_iter = __pyx_v_s.begin();

  /* "map.to_py":231
 *     cdef const map[X,Y].value_type *key_value
 *     cdef map[X,Y].const_iterator iter = s.begin()
 *     while iter != s.end():             # <<<<<<<<<<<<<<
 *         key_value = &cython.operator.dereference(iter)
 *         o[X_to_py(key_value.first)] = Y_to_py(key_value.second)
 */
  while (1) {
    __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0);
    if (!__pyx_t_2) break;

    /* "map.to_py":232
 *     cdef map[X,Y].const_iterator iter = s.begin()
 *     while iter != s.end():
 *         key_value = &cython.operator.dereference(iter)             # <<<<<<<<<<<<<<
 *         o[X_to_py(key_value.first)] = Y_to_py(key_value.second)
 *         cython.operator.preincrement(iter)
 */
    __pyx_v_key_value = (&(*__pyx_v_iter));

    /* "map.to_py":233
 *     while iter != s.end():
 *         key_value = &cython.operator.dereference(iter)
 *         o[X_to_py(key_value.first)] = Y_to_py(key_value.second)             # <<<<<<<<<<<<<<
 *         cython.operator.preincrement(iter)
 *     return o
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_convert_PyObject_string_to_py_std__in_string(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(2, 233, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "map.to_py":234
 *         key_value = &cython.operator.dereference(iter)
 *         o[X_to_py(key_value.first)] = Y_to_py(key_value.second)
 *         cython.operator.preincrement(iter)             # <<<<<<<<<<<<<<
 *     return o
 */
    (++__pyx_v_iter);
  }

  /* "map.to_py":235
 *         o[X_to_py(key_value.first)] = Y_to_py(key_value.second)
 *         cython.operator.preincrement(iter)
 *     return o             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_o);
  __pyx_r = __pyx_v_o;
  goto __pyx_L0;

  /* "map.to_py":227
 * 
 * @cname("__pyx_convert_map_to_py_std_3a__3a_string____double")
 * cdef object __pyx_convert_map_to_py_std_3a__3a_string____double(const map[X,Y]& s):             # <<<<<<<<<<<<<<
 *     o = {}
 *     cdef const map[X,Y].value_type *key_value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("map.to_py.__pyx_convert_map_to_py_std_3a__3a_string____double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_o);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.to_py":67
 * 
 * @cname("__pyx_convert_vector_to_py_double")
 * cdef object __pyx_convert_vector_to_py_double(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [X_to_py(v[i]) for i in range(v.size())]
 * 
 */

static PyObject *__pyx_convert_vector_to_py_double(const std::vector<double>  &__pyx_v_v) {
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_double", 0);

  /* "vector.to_py":68
 * @cname("__pyx_convert_vector_to_py_double")
 * cdef object __pyx_convert_vector_to_py_double(vector[X]& v):
 *     return [X_to_py(v[i]) for i in range(v.size())]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_v.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
    __pyx_t_4 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(2, 68, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "vector.to_py":67
 * 
 * @cname("__pyx_convert_vector_to_py_double")
 * cdef object __pyx_convert_vector_to_py_double(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [X_to_py(v[i]) for i in range(v.size())]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.from_py":49
 * 
 * @cname("__pyx_convert_vector_from_py_double")
 * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

static std::vector<double>  __pyx_convert_vector_from_py_double(PyObject *__pyx_v_o) {
  std::vector<double>  __pyx_v_v;
  PyObject *__pyx_v_item = NULL;
  std::vector<double>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_double", 0);

  /* "vector.from_py":51
 * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(X_from_py(item))
 *     return v
 */
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 51, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 51, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 51, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 51, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 51, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 51, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "vector.from_py":52
 *     cdef vector[X] v
 *     for item in o:
 *         v.push_back(X_from_py(item))             # <<<<<<<<<<<<<<
 *     return v
 * 
 */
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_item); if (unlikely(__pyx_t_5 == -1.0 && PyErr_Occurred())) __PYX_ERR(2, 52, __pyx_L1_error)
    __pyx_v_v.push_back(__pyx_t_5);

    /* "vector.from_py":51
 * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(X_from_py(item))
 *     return v
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.from_py":53
 *     for item in o:
 *         v.push_back(X_from_py(item))
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":49
 * 
 * @cname("__pyx_convert_vector_from_py_double")
 * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.to_py":67
 * 
 * @cname("__pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel")
 * cdef object __pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [X_to_py(v[i]) for i in range(v.size())]
 * 
 */

static PyObject *__pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel(const std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &__pyx_v_v) {
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel", 0);

  /* "vector.to_py":68
 * @cname("__pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel")
 * cdef object __pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel(vector[X]& v):
 *     return [X_to_py(v[i]) for i in range(v.size())]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_v.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;
    __pyx_t_4 = __pyx_convert__to_py_struct____pyx_t_9pylsewave_5cynum_cvessel((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(2, 68, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "vector.to_py":67
 * 
 * @cname("__pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel")
 * cdef object __pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [X_to_py(v[i]) for i in range(v.size())]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_struct____pyx_t_9pylsewave_5cynum_cvessel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":120
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

/* Python wrapper */
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_shape = 0;
  Py_ssize_t __pyx_v_itemsize;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_mode = 0;
  int __pyx_v_allocate_buffer;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_n_s_c);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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_shape)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error)
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_shape = ((PyObject*)values[0]);
    __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 120, __pyx_L3_error)
    __pyx_v_format = values[2];
    __pyx_v_mode = values[3];
    if (values[4]) {
      __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error)
    } else {

      /* "View.MemoryView":121
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
 *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
 * 
 *         cdef int idx
 */
      __pyx_v_allocate_buffer = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 120, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __pyx_L1_error)
  }
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);

  /* "View.MemoryView":120
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

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

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_dim;
  PyObject **__pyx_v_p;
  char __pyx_v_order;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_format);

  /* "View.MemoryView":127
 *         cdef PyObject **p
 * 
 *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
 *         self.itemsize = itemsize
 * 
 */
  if (unlikely(__pyx_v_shape == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 127, __pyx_L1_error)
  }
  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error)
  __pyx_v_self->ndim = ((int)__pyx_t_1);

  /* "View.MemoryView":128
 * 
 *         self.ndim = <int> len(shape)
 *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not self.ndim:
 */
  __pyx_v_self->itemsize = __pyx_v_itemsize;

  /* "View.MemoryView":130
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 */
  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":131
 * 
 *         if not self.ndim:
 *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if itemsize <= 0:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 131, __pyx_L1_error)

    /* "View.MemoryView":130
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 */
  }

  /* "View.MemoryView":133
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 */
  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":134
 * 
 *         if itemsize <= 0:
 *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(format, bytes):
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 134, __pyx_L1_error)

    /* "View.MemoryView":133
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 */
  }

  /* "View.MemoryView":136
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 */
  __pyx_t_2 = PyBytes_Check(__pyx_v_format); 
  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_4) {

    /* "View.MemoryView":137
 * 
 *         if not isinstance(format, bytes):
 *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "View.MemoryView":136
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 */
  }

  /* "View.MemoryView":138
 *         if not isinstance(format, bytes):
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
 *         self.format = self._format
 * 
 */
  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 138, __pyx_L1_error)
  __pyx_t_5 = __pyx_v_format;
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->_format);
  __Pyx_DECREF(__pyx_v_self->_format);
  __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "View.MemoryView":139
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error)
  __pyx_v_self->format = __pyx_t_6;

  /* "View.MemoryView":142
 * 
 * 
 *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
 *         self._strides = self._shape + self.ndim
 * 
 */
  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));

  /* "View.MemoryView":143
 * 
 *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
 *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
 * 
 *         if not self._shape:
 */
  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);

  /* "View.MemoryView":145
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError("unable to allocate shape and strides.")
 * 
 */
  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
  if (__pyx_t_4) {

    /* "View.MemoryView":146
 * 
 *         if not self._shape:
 *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(2, 146, __pyx_L1_error)

    /* "View.MemoryView":145
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError("unable to allocate shape and strides.")
 * 
 */
  }

  /* "View.MemoryView":149
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 */
  __pyx_t_7 = 0;
  __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 149, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 149, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_dim = __pyx_t_8;
    __pyx_v_idx = __pyx_t_7;
    __pyx_t_7 = (__pyx_t_7 + 1);

    /* "View.MemoryView":150
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 *             self._shape[idx] = dim
 */
    __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
    if (__pyx_t_4) {

      /* "View.MemoryView":151
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
 *             self._shape[idx] = dim
 * 
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
      __pyx_t_3 = 0;
      __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(2, 151, __pyx_L1_error)

      /* "View.MemoryView":150
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 *             self._shape[idx] = dim
 */
    }

    /* "View.MemoryView":152
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
 * 
 *         cdef char order
 */
    (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;

    /* "View.MemoryView":149
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "View.MemoryView":155
 * 
 *         cdef char order
 *         if mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 155, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "View.MemoryView":156
 *         cdef char order
 *         if mode == 'fortran':
 *             order = b'F'             # <<<<<<<<<<<<<<
 *             self.mode = u'fortran'
 *         elif mode == 'c':
 */
    __pyx_v_order = 'F';

    /* "View.MemoryView":157
 *         if mode == 'fortran':
 *             order = b'F'
 *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
 *         elif mode == 'c':
 *             order = b'C'
 */
    __Pyx_INCREF(__pyx_n_u_fortran);
    __Pyx_GIVEREF(__pyx_n_u_fortran);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_n_u_fortran;

    /* "View.MemoryView":155
 * 
 *         cdef char order
 *         if mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
 */
    goto __pyx_L10;
  }

  /* "View.MemoryView":158
 *             order = b'F'
 *             self.mode = u'fortran'
 *         elif mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "View.MemoryView":159
 *             self.mode = u'fortran'
 *         elif mode == 'c':
 *             order = b'C'             # <<<<<<<<<<<<<<
 *             self.mode = u'c'
 *         else:
 */
    __pyx_v_order = 'C';

    /* "View.MemoryView":160
 *         elif mode == 'c':
 *             order = b'C'
 *             self.mode = u'c'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
 */
    __Pyx_INCREF(__pyx_n_u_c);
    __Pyx_GIVEREF(__pyx_n_u_c);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_n_u_c;

    /* "View.MemoryView":158
 *             order = b'F'
 *             self.mode = u'fortran'
 *         elif mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
 */
    goto __pyx_L10;
  }

  /* "View.MemoryView":162
 *             self.mode = u'c'
 *         else:
 *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides,
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(2, 162, __pyx_L1_error)
  }
  __pyx_L10:;

  /* "View.MemoryView":164
 *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
 *                                              itemsize, self.ndim, order)
 * 
 */
  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);

  /* "View.MemoryView":167
 *                                              itemsize, self.ndim, order)
 * 
 *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
 *         self.dtype_is_object = format == b'O'
 *         if allocate_buffer:
 */
  __pyx_v_self->free_data = __pyx_v_allocate_buffer;

  /* "View.MemoryView":168
 * 
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
 *         if allocate_buffer:
 * 
 */
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_self->dtype_is_object = __pyx_t_4;

  /* "View.MemoryView":169
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
  if (__pyx_t_4) {

    /* "View.MemoryView":172
 * 
 * 
 *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")
 */
    __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));

    /* "View.MemoryView":173
 * 
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:             # <<<<<<<<<<<<<<
 *                 raise MemoryError("unable to allocate array data.")
 * 
 */
    __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
    if (__pyx_t_4) {

      /* "View.MemoryView":174
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_is_object:
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(2, 174, __pyx_L1_error)

      /* "View.MemoryView":173
 * 
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:             # <<<<<<<<<<<<<<
 *                 raise MemoryError("unable to allocate array data.")
 * 
 */
    }

    /* "View.MemoryView":176
 *                 raise MemoryError("unable to allocate array data.")
 * 
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):
 */
    __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
    if (__pyx_t_4) {

      /* "View.MemoryView":177
 * 
 *             if self.dtype_is_object:
 *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None
 */
      __pyx_v_p = ((PyObject **)__pyx_v_self->data);

      /* "View.MemoryView":178
 *             if self.dtype_is_object:
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
 *                     p[i] = Py_None
 *                     Py_INCREF(Py_None)
 */
      if (unlikely(__pyx_v_itemsize == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(2, 178, __pyx_L1_error)
      }
      else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
        PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
        __PYX_ERR(2, 178, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;

        /* "View.MemoryView":179
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None             # <<<<<<<<<<<<<<
 *                     Py_INCREF(Py_None)
 * 
 */
        (__pyx_v_p[__pyx_v_i]) = Py_None;

        /* "View.MemoryView":180
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None
 *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
        Py_INCREF(Py_None);
      }

      /* "View.MemoryView":176
 *                 raise MemoryError("unable to allocate array data.")
 * 
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):
 */
    }

    /* "View.MemoryView":169
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  }

  /* "View.MemoryView":120
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":183
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         cdef int bufmode = -1
 *         if self.mode == u"c":
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_array_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_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_bufmode;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t *__pyx_t_7;
  __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);
  }

  /* "View.MemoryView":184
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
 *         if self.mode == u"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 */
  __pyx_v_bufmode = -1;

  /* "View.MemoryView":185
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if self.mode == u"c":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":186
 *         cdef int bufmode = -1
 *         if self.mode == u"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *         elif self.mode == u"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 */
    __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);

    /* "View.MemoryView":185
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if self.mode == u"c":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":187
 *         if self.mode == u"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":188
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 */
    __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);

    /* "View.MemoryView":187
 *         if self.mode == u"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 */
  }
  __pyx_L3:;

  /* "View.MemoryView":189
 *         elif self.mode == u"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data
 */
  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":190
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
 *         info.buf = self.data
 *         info.len = self.len
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 190, __pyx_L1_error)

    /* "View.MemoryView":189
 *         elif self.mode == u"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data
 */
  }

  /* "View.MemoryView":191
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data             # <<<<<<<<<<<<<<
 *         info.len = self.len
 *         info.ndim = self.ndim
 */
  __pyx_t_4 = __pyx_v_self->data;
  __pyx_v_info->buf = __pyx_t_4;

  /* "View.MemoryView":192
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data
 *         info.len = self.len             # <<<<<<<<<<<<<<
 *         info.ndim = self.ndim
 *         info.shape = self._shape
 */
  __pyx_t_5 = __pyx_v_self->len;
  __pyx_v_info->len = __pyx_t_5;

  /* "View.MemoryView":193
 *         info.buf = self.data
 *         info.len = self.len
 *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
 *         info.shape = self._shape
 *         info.strides = self._strides
 */
  __pyx_t_6 = __pyx_v_self->ndim;
  __pyx_v_info->ndim = __pyx_t_6;

  /* "View.MemoryView":194
 *         info.len = self.len
 *         info.ndim = self.ndim
 *         info.shape = self._shape             # <<<<<<<<<<<<<<
 *         info.strides = self._strides
 *         info.suboffsets = NULL
 */
  __pyx_t_7 = __pyx_v_self->_shape;
  __pyx_v_info->shape = __pyx_t_7;

  /* "View.MemoryView":195
 *         info.ndim = self.ndim
 *         info.shape = self._shape
 *         info.strides = self._strides             # <<<<<<<<<<<<<<
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize
 */
  __pyx_t_7 = __pyx_v_self->_strides;
  __pyx_v_info->strides = __pyx_t_7;

  /* "View.MemoryView":196
 *         info.shape = self._shape
 *         info.strides = self._strides
 *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         info.itemsize = self.itemsize
 *         info.readonly = 0
 */
  __pyx_v_info->suboffsets = NULL;

  /* "View.MemoryView":197
 *         info.strides = self._strides
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
 *         info.readonly = 0
 * 
 */
  __pyx_t_5 = __pyx_v_self->itemsize;
  __pyx_v_info->itemsize = __pyx_t_5;

  /* "View.MemoryView":198
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize
 *         info.readonly = 0             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
  __pyx_v_info->readonly = 0;

  /* "View.MemoryView":200
 *         info.readonly = 0
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.format
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":201
 * 
 *         if flags & PyBUF_FORMAT:
 *             info.format = self.format             # <<<<<<<<<<<<<<
 *         else:
 *             info.format = NULL
 */
    __pyx_t_4 = __pyx_v_self->format;
    __pyx_v_info->format = __pyx_t_4;

    /* "View.MemoryView":200
 *         info.readonly = 0
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.format
 *         else:
 */
    goto __pyx_L5;
  }

  /* "View.MemoryView":203
 *             info.format = self.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.obj = self
 */
  /*else*/ {
    __pyx_v_info->format = NULL;
  }
  __pyx_L5:;

  /* "View.MemoryView":205
 *             info.format = NULL
 * 
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":183
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         cdef int bufmode = -1
 *         if self.mode == u"c":
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.array.__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_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":209
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 */

/* Python wrapper */
static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));

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

static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":210
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 */
  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":211
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
 *         elif self.free_data:
 *             if self.dtype_is_object:
 */
    __pyx_v_self->callback_free_data(__pyx_v_self->data);

    /* "View.MemoryView":210
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":212
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape,
 */
  __pyx_t_1 = (__pyx_v_self->free_data != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":213
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape,
 *                                           self._strides, self.ndim, False)
 */
    __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":214
 *         elif self.free_data:
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
 *                                           self._strides, self.ndim, False)
 *             free(self.data)
 */
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);

      /* "View.MemoryView":213
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape,
 *                                           self._strides, self.ndim, False)
 */
    }

    /* "View.MemoryView":216
 *                 refcount_objects_in_slice(self.data, self._shape,
 *                                           self._strides, self.ndim, False)
 *             free(self.data)             # <<<<<<<<<<<<<<
 *         PyObject_Free(self._shape)
 * 
 */
    free(__pyx_v_self->data);

    /* "View.MemoryView":212
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape,
 */
  }
  __pyx_L3:;

  /* "View.MemoryView":217
 *                                           self._strides, self.ndim, False)
 *             free(self.data)
 *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  PyObject_Free(__pyx_v_self->_shape);

  /* "View.MemoryView":209
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 */

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

/* "View.MemoryView":220
 * 
 *     @property
 *     def memview(self):             # <<<<<<<<<<<<<<
 *         return self.get_memview()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":221
 *     @property
 *     def memview(self):
 *         return self.get_memview()             # <<<<<<<<<<<<<<
 * 
 *     @cname('get_memview')
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":220
 * 
 *     @property
 *     def memview(self):             # <<<<<<<<<<<<<<
 *         return self.get_memview()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":224
 * 
 *     @cname('get_memview')
 *     cdef get_memview(self):             # <<<<<<<<<<<<<<
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *         return  memoryview(self, flags, self.dtype_is_object)
 */

static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_memview", 0);

  /* "View.MemoryView":225
 *     @cname('get_memview')
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
 */
  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);

  /* "View.MemoryView":226
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __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;

  /* "View.MemoryView":224
 * 
 *     @cname('get_memview')
 *     cdef get_memview(self):             # <<<<<<<<<<<<<<
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *         return  memoryview(self, flags, self.dtype_is_object)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":229
 * 
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));

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

static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "View.MemoryView":230
 * 
 *     def __getattr__(self, attr):
 *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":229
 * 
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":232
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));

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

static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "View.MemoryView":233
 * 
 *     def __getitem__(self, item):
 *         return self.memview[item]             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, item, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":232
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":235
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
 */

/* Python wrapper */
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));

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

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "View.MemoryView":236
 * 
 *     def __setitem__(self, item, value):
 *         self.memview[item] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":235
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":240
 * 
 * @cname("__pyx_array_new")
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
 *                           char *mode, char *buf):
 *     cdef array result
 */

static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
  struct __pyx_array_obj *__pyx_v_result = 0;
  struct __pyx_array_obj *__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;
  __Pyx_RefNannySetupContext("array_cwrapper", 0);

  /* "View.MemoryView":244
 *     cdef array result
 * 
 *     if buf == NULL:             # <<<<<<<<<<<<<<
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":245
 * 
 *     if buf == NULL:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "View.MemoryView":244
 *     cdef array result
 * 
 *     if buf == NULL:             # <<<<<<<<<<<<<<
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":247
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
 *                        allocate_buffer=False)
 *         result.data = buf
 */
  /*else*/ {
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_3 = 0;

    /* "View.MemoryView":248
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
 *         result.data = buf
 * 
 */
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error)

    /* "View.MemoryView":247
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
 *                        allocate_buffer=False)
 *         result.data = buf
 */
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __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_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "View.MemoryView":249
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 *                        allocate_buffer=False)
 *         result.data = buf             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_v_result->data = __pyx_v_buf;
  }
  __pyx_L3:;

  /* "View.MemoryView":251
 *         result.data = buf
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":240
 * 
 * @cname("__pyx_array_new")
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
 *                           char *mode, char *buf):
 *     cdef array result
 */

  /* 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_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":277
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
 */

/* Python wrapper */
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 277, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);

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

static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "View.MemoryView":278
 *     cdef object name
 *     def __init__(self, name):
 *         self.name = name             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return self.name
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "View.MemoryView":277
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
 */

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

/* "View.MemoryView":279
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
 */

/* Python wrapper */
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));

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

static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":280
 *         self.name = name
 *     def __repr__(self):
 *         return self.name             # <<<<<<<<<<<<<<
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* "View.MemoryView":279
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
 */

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

/* "View.MemoryView":294
 * 
 * @cname('__pyx_align_pointer')
 * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
 *     "Align pointer memory on a given boundary"
 *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
 */

static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
  Py_intptr_t __pyx_v_aligned_p;
  size_t __pyx_v_offset;
  void *__pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":296
 * cdef void *align_pointer(void *memory, size_t alignment) nogil:
 *     "Align pointer memory on a given boundary"
 *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
 *     cdef size_t offset
 * 
 */
  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);

  /* "View.MemoryView":300
 * 
 *     with cython.cdivision(True):
 *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
 * 
 *     if offset > 0:
 */
  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);

  /* "View.MemoryView":302
 *         offset = aligned_p % alignment
 * 
 *     if offset > 0:             # <<<<<<<<<<<<<<
 *         aligned_p += alignment - offset
 * 
 */
  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":303
 * 
 *     if offset > 0:
 *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
 * 
 *     return <void *> aligned_p
 */
    __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));

    /* "View.MemoryView":302
 *         offset = aligned_p % alignment
 * 
 *     if offset > 0:             # <<<<<<<<<<<<<<
 *         aligned_p += alignment - offset
 * 
 */
  }

  /* "View.MemoryView":305
 *         aligned_p += alignment - offset
 * 
 *     return <void *> aligned_p             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((void *)__pyx_v_aligned_p);
  goto __pyx_L0;

  /* "View.MemoryView":294
 * 
 * @cname('__pyx_align_pointer')
 * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
 *     "Align pointer memory on a given boundary"
 *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":341
 *     cdef __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
 */

/* Python wrapper */
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  int __pyx_v_flags;
  int __pyx_v_dtype_is_object;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,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_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __pyx_L3_error)
    } else {
      __pyx_v_dtype_is_object = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);

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

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "View.MemoryView":342
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj             # <<<<<<<<<<<<<<
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 */
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  __Pyx_GOTREF(__pyx_v_self->obj);
  __Pyx_DECREF(__pyx_v_self->obj);
  __pyx_v_self->obj = __pyx_v_obj;

  /* "View.MemoryView":343
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj
 *         self.flags = flags             # <<<<<<<<<<<<<<
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 */
  __pyx_v_self->flags = __pyx_v_flags;

  /* "View.MemoryView":344
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 */
  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_obj != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "View.MemoryView":345
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 */
    __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 345, __pyx_L1_error)

    /* "View.MemoryView":346
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
 */
    __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":347
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
 *                 Py_INCREF(Py_None)
 * 
 */
      ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;

      /* "View.MemoryView":348
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         global __pyx_memoryview_thread_locks_used
 */
      Py_INCREF(Py_None);

      /* "View.MemoryView":346
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
 */
    }

    /* "View.MemoryView":344
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 */
  }

  /* "View.MemoryView":351
 * 
 *         global __pyx_memoryview_thread_locks_used
 *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *             __pyx_memoryview_thread_locks_used += 1
 */
  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":352
 *         global __pyx_memoryview_thread_locks_used
 *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
 *             __pyx_memoryview_thread_locks_used += 1
 *         if self.lock is NULL:
 */
    __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);

    /* "View.MemoryView":353
 *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
 *         if self.lock is NULL:
 *             self.lock = PyThread_allocate_lock()
 */
    __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);

    /* "View.MemoryView":351
 * 
 *         global __pyx_memoryview_thread_locks_used
 *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *             __pyx_memoryview_thread_locks_used += 1
 */
  }

  /* "View.MemoryView":354
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *             __pyx_memoryview_thread_locks_used += 1
 *         if self.lock is NULL:             # <<<<<<<<<<<<<<
 *             self.lock = PyThread_allocate_lock()
 *             if self.lock is NULL:
 */
  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":355
 *             __pyx_memoryview_thread_locks_used += 1
 *         if self.lock is NULL:
 *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
 *             if self.lock is NULL:
 *                 raise MemoryError
 */
    __pyx_v_self->lock = PyThread_allocate_lock();

    /* "View.MemoryView":356
 *         if self.lock is NULL:
 *             self.lock = PyThread_allocate_lock()
 *             if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 * 
 */
    __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":357
 *             self.lock = PyThread_allocate_lock()
 *             if self.lock is NULL:
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
      PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error)

      /* "View.MemoryView":356
 *         if self.lock is NULL:
 *             self.lock = PyThread_allocate_lock()
 *             if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 * 
 */
    }

    /* "View.MemoryView":354
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *             __pyx_memoryview_thread_locks_used += 1
 *         if self.lock is NULL:             # <<<<<<<<<<<<<<
 *             self.lock = PyThread_allocate_lock()
 *             if self.lock is NULL:
 */
  }

  /* "View.MemoryView":359
 *                 raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":360
 * 
 *         if flags & PyBUF_FORMAT:
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
 *         else:
 *             self.dtype_is_object = dtype_is_object
 */
    __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L11_bool_binop_done:;
    __pyx_v_self->dtype_is_object = __pyx_t_1;

    /* "View.MemoryView":359
 *                 raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
 */
    goto __pyx_L10;
  }

  /* "View.MemoryView":362
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
 *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
 * 
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
 */
  /*else*/ {
    __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
  }
  __pyx_L10:;

  /* "View.MemoryView":364
 *             self.dtype_is_object = dtype_is_object
 * 
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
 *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
 *         self.typeinfo = NULL
 */
  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));

  /* "View.MemoryView":366
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
 *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
 *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(memoryview self):
 */
  __pyx_v_self->typeinfo = NULL;

  /* "View.MemoryView":341
 *     cdef __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":368
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 */

/* Python wrapper */
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
  int __pyx_v_i;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyThread_type_lock __pyx_t_5;
  PyThread_type_lock __pyx_t_6;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":369
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_ReleaseBuffer(&self.view)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":370
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
 * 
 *         cdef int i
 */
    __Pyx_ReleaseBuffer((&__pyx_v_self->view));

    /* "View.MemoryView":369
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_ReleaseBuffer(&self.view)
 * 
 */
  }

  /* "View.MemoryView":374
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 */
  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":375
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:
 *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 */
    __pyx_t_3 = __pyx_memoryview_thread_locks_used;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":376
 *         if self.lock != NULL:
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
 */
      __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":377
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 */
        __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);

        /* "View.MemoryView":378
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 */
        __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":380
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
 *                     break
 *             else:
 */
          __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
          __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);

          /* "View.MemoryView":379
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 *                     break
 */
          (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
          (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;

          /* "View.MemoryView":378
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 */
        }

        /* "View.MemoryView":381
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 *                     break             # <<<<<<<<<<<<<<
 *             else:
 *                 PyThread_free_lock(self.lock)
 */
        goto __pyx_L6_break;

        /* "View.MemoryView":376
 *         if self.lock != NULL:
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
 */
      }
    }
    /*else*/ {

      /* "View.MemoryView":383
 *                     break
 *             else:
 *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 */
      PyThread_free_lock(__pyx_v_self->lock);
    }
    __pyx_L6_break:;

    /* "View.MemoryView":374
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 */
  }

  /* "View.MemoryView":368
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 */

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

/* "View.MemoryView":385
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
 */

static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  Py_ssize_t __pyx_v_dim;
  char *__pyx_v_itemp;
  PyObject *__pyx_v_idx = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  char *__pyx_t_7;
  __Pyx_RefNannySetupContext("get_item_pointer", 0);

  /* "View.MemoryView":387
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
 * 
 *         for dim, idx in enumerate(index):
 */
  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);

  /* "View.MemoryView":389
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 */
  __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 389, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 389, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_1;
    __pyx_t_1 = (__pyx_t_1 + 1);

    /* "View.MemoryView":390
 * 
 *         for dim, idx in enumerate(index):
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
 * 
 *         return itemp
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __pyx_L1_error)
    __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 390, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_7;

    /* "View.MemoryView":389
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":392
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 *         return itemp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_itemp;
  goto __pyx_L0;

  /* "View.MemoryView":385
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":395
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_indices = NULL;
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "View.MemoryView":396
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":397
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_r = ((PyObject *)__pyx_v_self);
    goto __pyx_L0;

    /* "View.MemoryView":396
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  }

  /* "View.MemoryView":399
 *             return self
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         cdef char *itemp
 */
  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(__pyx_t_3 != Py_None)) {
    PyObject* sequence = __pyx_t_3;
    #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_ERR(2, 399, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __pyx_L1_error)
  }
  __pyx_v_have_slices = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_indices = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "View.MemoryView":402
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 402, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "View.MemoryView":403
 *         cdef char *itemp
 *         if have_slices:
 *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
 *         else:
 *             itemp = self.get_item_pointer(indices)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":402
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
 */
  }

  /* "View.MemoryView":405
 *             return memview_slice(self, indices)
 *         else:
 *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
 *             return self.convert_item_to_object(itemp)
 * 
 */
  /*else*/ {
    __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 405, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_6;

    /* "View.MemoryView":406
 *         else:
 *             itemp = self.get_item_pointer(indices)
 *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(memoryview self, object index, object value):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":395
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":408
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 */

/* Python wrapper */
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

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

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_obj = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "View.MemoryView":409
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         if have_slices:
 */
  __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    #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_ERR(2, 409, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error)
  }
  __pyx_v_have_slices = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "View.MemoryView":411
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "View.MemoryView":412
 * 
 *         if have_slices:
 *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
 *             if obj:
 *                 self.setitem_slice_assignment(self[index], obj)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_obj = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "View.MemoryView":413
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "View.MemoryView":414
 *             obj = self.is_slice(value)
 *             if obj:
 *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)
 */
      __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "View.MemoryView":413
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 */
      goto __pyx_L4;
    }

    /* "View.MemoryView":416
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
 *         else:
 *             self.setitem_indexed(index, value)
 */
    /*else*/ {
      __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __pyx_L1_error)
      __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L4:;

    /* "View.MemoryView":411
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":418
 *                 self.setitem_slice_assign_scalar(self[index], value)
 *         else:
 *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef is_slice(self, obj):
 */
  /*else*/ {
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":408
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":420
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
 */

static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("is_slice", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "View.MemoryView":421
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":422
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "View.MemoryView":423
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
 */
        __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "View.MemoryView":424
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
 *             except TypeError:
 *                 return None
 */
        __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);

        /* "View.MemoryView":423
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
 */
        __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
        __pyx_t_6 = 0;
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 423, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "View.MemoryView":422
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L11_try_end;
      __pyx_L4_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "View.MemoryView":425
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 425, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_6);

        /* "View.MemoryView":426
 *                                  self.dtype_is_object)
 *             except TypeError:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         return obj
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_None);
        __pyx_r = Py_None;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_except_return;
      }
      goto __pyx_L6_except_error;
      __pyx_L6_except_error:;

      /* "View.MemoryView":422
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L7_except_return:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L0;
      __pyx_L11_try_end:;
    }

    /* "View.MemoryView":421
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
 */
  }

  /* "View.MemoryView":428
 *                 return None
 * 
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assignment(self, dst, src):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "View.MemoryView":420
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":430
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 */

static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
  __Pyx_memviewslice __pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_src_slice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);

  /* "View.MemoryView":434
 *         cdef __Pyx_memviewslice src_slice
 * 
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
 *                                  get_slice_from_memview(dst, &dst_slice)[0],
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 */
  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error)

  /* "View.MemoryView":435
 * 
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
 *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 * 
 */
  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error)

  /* "View.MemoryView":436
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
 *                                  get_slice_from_memview(dst, &dst_slice)[0],
 *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":434
 *         cdef __Pyx_memviewslice src_slice
 * 
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
 *                                  get_slice_from_memview(dst, &dst_slice)[0],
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 */
  __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 434, __pyx_L1_error)

  /* "View.MemoryView":430
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":438
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
 */

static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
  int __pyx_v_array[0x80];
  void *__pyx_v_tmp;
  void *__pyx_v_item;
  __Pyx_memviewslice *__pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_tmp_slice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  char const *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);

  /* "View.MemoryView":440
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 *         cdef int array[128]
 *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
 *         cdef void *item
 * 
 */
  __pyx_v_tmp = NULL;

  /* "View.MemoryView":445
 *         cdef __Pyx_memviewslice *dst_slice
 *         cdef __Pyx_memviewslice tmp_slice
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 */
  __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));

  /* "View.MemoryView":447
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 */
  __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":448
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
 *             if tmp == NULL:
 *                 raise MemoryError
 */
    __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);

    /* "View.MemoryView":449
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
 */
    __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":450
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *             item = tmp
 *         else:
 */
      PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error)

      /* "View.MemoryView":449
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
 */
    }

    /* "View.MemoryView":451
 *             if tmp == NULL:
 *                 raise MemoryError
 *             item = tmp             # <<<<<<<<<<<<<<
 *         else:
 *             item = <void *> array
 */
    __pyx_v_item = __pyx_v_tmp;

    /* "View.MemoryView":447
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":453
 *             item = tmp
 *         else:
 *             item = <void *> array             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  /*else*/ {
    __pyx_v_item = ((void *)__pyx_v_array);
  }
  __pyx_L3:;

  /* "View.MemoryView":455
 *             item = <void *> array
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value
 */
  /*try:*/ {

    /* "View.MemoryView":456
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 */
    __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":457
 *         try:
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)
 */
      (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);

      /* "View.MemoryView":456
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 */
      goto __pyx_L8;
    }

    /* "View.MemoryView":459
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L8:;

    /* "View.MemoryView":463
 * 
 * 
 *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 */
    __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":464
 * 
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 *                                 item, self.dtype_is_object)
 */
      __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "View.MemoryView":463
 * 
 * 
 *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 */
    }

    /* "View.MemoryView":465
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
 *                                 item, self.dtype_is_object)
 *         finally:
 */
    __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
  }

  /* "View.MemoryView":468
 *                                 item, self.dtype_is_object)
 *         finally:
 *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_indexed(self, index, value):
 */
  /*finally:*/ {
    /*normal exit:*/{
      PyMem_Free(__pyx_v_tmp);
      goto __pyx_L7;
    }
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __pyx_L6_error:;
      __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
      {
        PyMem_Free(__pyx_v_tmp);
      }
      __Pyx_PyThreadState_assign
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
      __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
      goto __pyx_L1_error;
    }
    __pyx_L7:;
  }

  /* "View.MemoryView":438
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":470
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
 */

static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("setitem_indexed", 0);

  /* "View.MemoryView":471
 * 
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
 *         self.assign_item_from_object(itemp, value)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 471, __pyx_L1_error)
  __pyx_v_itemp = __pyx_t_1;

  /* "View.MemoryView":472
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":470
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":474
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_v_struct = NULL;
  PyObject *__pyx_v_bytesitem = 0;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":477
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef bytes bytesitem
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":480
 *         cdef bytes bytesitem
 * 
 *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 */
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":481
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "View.MemoryView":482
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_8 = 1;
        }
      }
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
      __Pyx_INCREF(__pyx_v_bytesitem);
      __Pyx_GIVEREF(__pyx_v_bytesitem);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "View.MemoryView":481
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 */
    }

    /* "View.MemoryView":486
 *             raise ValueError("Unable to convert item to object")
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
 */
    /*else:*/ {
      __pyx_t_10 = strlen(__pyx_v_self->view.format); 
      __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
      if (__pyx_t_11) {

        /* "View.MemoryView":487
 *         else:
 *             if len(self.view.format) == 1:
 *                 return result[0]             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 487, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L6_except_return;

        /* "View.MemoryView":486
 *             raise ValueError("Unable to convert item to object")
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
 */
      }

      /* "View.MemoryView":488
 *             if len(self.view.format) == 1:
 *                 return result[0]
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L6_except_return;
    }
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "View.MemoryView":483
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:             # <<<<<<<<<<<<<<
 *             raise ValueError("Unable to convert item to object")
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_12) {
      __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_9);

      /* "View.MemoryView":484
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
 *         else:
 *             if len(self.view.format) == 1:
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(2, 484, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "View.MemoryView":481
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "View.MemoryView":474
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesitem);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":490
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_struct = NULL;
  char __pyx_v_c;
  PyObject *__pyx_v_bytesvalue = 0;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  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;
  PyObject *__pyx_t_9 = NULL;
  char *__pyx_t_10;
  char *__pyx_t_11;
  char *__pyx_t_12;
  char *__pyx_t_13;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":493
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef char c
 *         cdef bytes bytesvalue
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":498
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_value); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "View.MemoryView":499
 * 
 *         if isinstance(value, tuple):
 *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 499, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "View.MemoryView":498
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":501
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
 * 
 *         for i, c in enumerate(bytesvalue):
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
    __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 501, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":503
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(2, 503, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_v_bytesvalue);
  __pyx_t_9 = __pyx_v_bytesvalue;
  __pyx_t_11 = PyBytes_AS_STRING(__pyx_t_9);
  __pyx_t_12 = (__pyx_t_11 + PyBytes_GET_SIZE(__pyx_t_9));
  for (__pyx_t_13 = __pyx_t_11; __pyx_t_13 < __pyx_t_12; __pyx_t_13++) {
    __pyx_t_10 = __pyx_t_13;
    __pyx_v_c = (__pyx_t_10[0]);

    /* "View.MemoryView":504
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
    __pyx_v_i = __pyx_t_7;

    /* "View.MemoryView":503
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
 */
    __pyx_t_7 = (__pyx_t_7 + 1);

    /* "View.MemoryView":504
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
    (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "View.MemoryView":490
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":507
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         if flags & PyBUF_STRIDES:
 *             info.shape = self.view.shape
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_memoryview_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_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  char *__pyx_t_3;
  void *__pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  __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);
  }

  /* "View.MemoryView":508
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":509
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_STRIDES:
 *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
 *         else:
 *             info.shape = NULL
 */
    __pyx_t_2 = __pyx_v_self->view.shape;
    __pyx_v_info->shape = __pyx_t_2;

    /* "View.MemoryView":508
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":511
 *             info.shape = self.view.shape
 *         else:
 *             info.shape = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_STRIDES:
 */
  /*else*/ {
    __pyx_v_info->shape = NULL;
  }
  __pyx_L3:;

  /* "View.MemoryView":513
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":514
 * 
 *         if flags & PyBUF_STRIDES:
 *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
 *         else:
 *             info.strides = NULL
 */
    __pyx_t_2 = __pyx_v_self->view.strides;
    __pyx_v_info->strides = __pyx_t_2;

    /* "View.MemoryView":513
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
 */
    goto __pyx_L4;
  }

  /* "View.MemoryView":516
 *             info.strides = self.view.strides
 *         else:
 *             info.strides = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_INDIRECT:
 */
  /*else*/ {
    __pyx_v_info->strides = NULL;
  }
  __pyx_L4:;

  /* "View.MemoryView":518
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":519
 * 
 *         if flags & PyBUF_INDIRECT:
 *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
 *         else:
 *             info.suboffsets = NULL
 */
    __pyx_t_2 = __pyx_v_self->view.suboffsets;
    __pyx_v_info->suboffsets = __pyx_t_2;

    /* "View.MemoryView":518
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
 */
    goto __pyx_L5;
  }

  /* "View.MemoryView":521
 *             info.suboffsets = self.view.suboffsets
 *         else:
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
  /*else*/ {
    __pyx_v_info->suboffsets = NULL;
  }
  __pyx_L5:;

  /* "View.MemoryView":523
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":524
 * 
 *         if flags & PyBUF_FORMAT:
 *             info.format = self.view.format             # <<<<<<<<<<<<<<
 *         else:
 *             info.format = NULL
 */
    __pyx_t_3 = __pyx_v_self->view.format;
    __pyx_v_info->format = __pyx_t_3;

    /* "View.MemoryView":523
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
 */
    goto __pyx_L6;
  }

  /* "View.MemoryView":526
 *             info.format = self.view.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.buf = self.view.buf
 */
  /*else*/ {
    __pyx_v_info->format = NULL;
  }
  __pyx_L6:;

  /* "View.MemoryView":528
 *             info.format = NULL
 * 
 *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 */
  __pyx_t_4 = __pyx_v_self->view.buf;
  __pyx_v_info->buf = __pyx_t_4;

  /* "View.MemoryView":529
 * 
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 */
  __pyx_t_5 = __pyx_v_self->view.ndim;
  __pyx_v_info->ndim = __pyx_t_5;

  /* "View.MemoryView":530
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
 *         info.len = self.view.len
 *         info.readonly = 0
 */
  __pyx_t_6 = __pyx_v_self->view.itemsize;
  __pyx_v_info->itemsize = __pyx_t_6;

  /* "View.MemoryView":531
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len             # <<<<<<<<<<<<<<
 *         info.readonly = 0
 *         info.obj = self
 */
  __pyx_t_6 = __pyx_v_self->view.len;
  __pyx_v_info->len = __pyx_t_6;

  /* "View.MemoryView":532
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 *         info.readonly = 0             # <<<<<<<<<<<<<<
 *         info.obj = self
 * 
 */
  __pyx_v_info->readonly = 0;

  /* "View.MemoryView":533
 *         info.len = self.view.len
 *         info.readonly = 0
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":507
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         if flags & PyBUF_STRIDES:
 *             info.shape = self.view.shape
 */

  /* function exit code */
  __pyx_r = 0;
  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_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":539
 * 
 *     @property
 *     def T(self):             # <<<<<<<<<<<<<<
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":540
 *     @property
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&result.from_slice)
 *         return result
 */
  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":541
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error)

  /* "View.MemoryView":542
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":539
 * 
 *     @property
 *     def T(self):             # <<<<<<<<<<<<<<
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":545
 * 
 *     @property
 *     def base(self):             # <<<<<<<<<<<<<<
 *         return self.obj
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":546
 *     @property
 *     def base(self):
 *         return self.obj             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->obj);
  __pyx_r = __pyx_v_self->obj;
  goto __pyx_L0;

  /* "View.MemoryView":545
 * 
 *     @property
 *     def base(self):             # <<<<<<<<<<<<<<
 *         return self.obj
 * 
 */

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

/* "View.MemoryView":549
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":550
 *     @property
 *     def shape(self):
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_v_length = (__pyx_t_2[0]);
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":549
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":553
 * 
 *     @property
 *     def strides(self):             # <<<<<<<<<<<<<<
 *         if self.view.strides == NULL:
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_stride;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":554
 *     @property
 *     def strides(self):
 *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError("Buffer view does not expose strides")
 */
  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":556
 *         if self.view.strides == NULL:
 * 
 *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 556, __pyx_L1_error)

    /* "View.MemoryView":554
 *     @property
 *     def strides(self):
 *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError("Buffer view does not expose strides")
 */
  }

  /* "View.MemoryView":558
 *             raise ValueError("Buffer view does not expose strides")
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
    __pyx_t_3 = __pyx_t_5;
    __pyx_v_stride = (__pyx_t_3[0]);
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":553
 * 
 *     @property
 *     def strides(self):             # <<<<<<<<<<<<<<
 *         if self.view.strides == NULL:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":561
 * 
 *     @property
 *     def suboffsets(self):             # <<<<<<<<<<<<<<
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  Py_ssize_t *__pyx_t_6;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":562
 *     @property
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             return (-1,) * self.view.ndim
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":563
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__53, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":562
 *     @property
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             return (-1,) * self.view.ndim
 * 
 */
  }

  /* "View.MemoryView":565
 *             return (-1,) * self.view.ndim
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
    __pyx_t_4 = __pyx_t_6;
    __pyx_v_suboffset = (__pyx_t_4[0]);
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __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;

  /* "View.MemoryView":561
 * 
 *     @property
 *     def suboffsets(self):             # <<<<<<<<<<<<<<
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":568
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.view.ndim
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":569
 *     @property
 *     def ndim(self):
 *         return self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":568
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.view.ndim
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":572
 * 
 *     @property
 *     def itemsize(self):             # <<<<<<<<<<<<<<
 *         return self.view.itemsize
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":573
 *     @property
 *     def itemsize(self):
 *         return self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":572
 * 
 *     @property
 *     def itemsize(self):             # <<<<<<<<<<<<<<
 *         return self.view.itemsize
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":576
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         return self.size * self.view.itemsize
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":577
 *     @property
 *     def nbytes(self):
 *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":576
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         return self.size * self.view.itemsize
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":580
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         if self._size is None:
 *             result = 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":581
 *     @property
 *     def size(self):
 *         if self._size is None:             # <<<<<<<<<<<<<<
 *             result = 1
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":582
 *     def size(self):
 *         if self._size is None:
 *             result = 1             # <<<<<<<<<<<<<<
 * 
 *             for length in self.view.shape[:self.view.ndim]:
 */
    __Pyx_INCREF(__pyx_int_1);
    __pyx_v_result = __pyx_int_1;

    /* "View.MemoryView":584
 *             result = 1
 * 
 *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
 *                 result *= length
 * 
 */
    __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
    for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "View.MemoryView":585
 * 
 *             for length in self.view.shape[:self.view.ndim]:
 *                 result *= length             # <<<<<<<<<<<<<<
 * 
 *             self._size = result
 */
      __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
      __pyx_t_6 = 0;
    }

    /* "View.MemoryView":587
 *                 result *= length
 * 
 *             self._size = result             # <<<<<<<<<<<<<<
 * 
 *         return self._size
 */
    __Pyx_INCREF(__pyx_v_result);
    __Pyx_GIVEREF(__pyx_v_result);
    __Pyx_GOTREF(__pyx_v_self->_size);
    __Pyx_DECREF(__pyx_v_self->_size);
    __pyx_v_self->_size = __pyx_v_result;

    /* "View.MemoryView":581
 *     @property
 *     def size(self):
 *         if self._size is None:             # <<<<<<<<<<<<<<
 *             result = 1
 * 
 */
  }

  /* "View.MemoryView":589
 *             self._size = result
 * 
 *         return self._size             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_size);
  __pyx_r = __pyx_v_self->_size;
  goto __pyx_L0;

  /* "View.MemoryView":580
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         if self._size is None:
 *             result = 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":591
 *         return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
 */

/* Python wrapper */
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "View.MemoryView":592
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":593
 *     def __len__(self):
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
    __pyx_r = (__pyx_v_self->view.shape[0]);
    goto __pyx_L0;

    /* "View.MemoryView":592
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
 */
  }

  /* "View.MemoryView":595
 *             return self.view.shape[0]
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":591
 *         return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
 */

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

/* "View.MemoryView":597
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":598
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":599
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":598
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":597
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":601
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "View.MemoryView":602
 * 
 *     def __str__(self):
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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_ERR(2, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":601
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":605
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_c_contig", 0);

  /* "View.MemoryView":608
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 */
  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));

  /* "View.MemoryView":609
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def is_f_contig(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":605
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":611
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_f_contig", 0);

  /* "View.MemoryView":614
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 */
  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));

  /* "View.MemoryView":615
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":611
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":617
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_mslice;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "View.MemoryView":619
 *     def copy(self):
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &mslice)
 */
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));

  /* "View.MemoryView":621
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 * 
 *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
 *                                    self.view.itemsize,
 */
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));

  /* "View.MemoryView":622
 * 
 *         slice_copy(self, &mslice)
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                    self.view.itemsize,
 *                                    flags|PyBUF_C_CONTIGUOUS,
 */
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 622, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":627
 *                                    self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
 * 
 *     def copy_fortran(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":617
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":629
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_fortran", 0);

  /* "View.MemoryView":631
 *     def copy_fortran(self):
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &src)
 */
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));

  /* "View.MemoryView":633
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 * 
 *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
 *                                 self.view.itemsize,
 */
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));

  /* "View.MemoryView":634
 * 
 *         slice_copy(self, &src)
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                 self.view.itemsize,
 *                                 flags|PyBUF_F_CONTIGUOUS,
 */
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 634, __pyx_L1_error)
  __pyx_v_dst = __pyx_t_1;

  /* "View.MemoryView":639
 *                                 self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":629
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":643
 * 
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 */

static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
  struct __pyx_memoryview_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);

  /* "View.MemoryView":644
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
 *     result.typeinfo = typeinfo
 *     return result
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_o);
  __Pyx_GIVEREF(__pyx_v_o);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":645
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_v_result->typeinfo = __pyx_v_typeinfo;

  /* "View.MemoryView":646
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_check')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":643
 * 
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":649
 * 
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
 *     return isinstance(o, memoryview)
 * 
 */

static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("memoryview_check", 0);

  /* "View.MemoryView":650
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o):
 *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
 * 
 * cdef tuple _unellipsify(object index, int ndim):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "View.MemoryView":649
 * 
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
 *     return isinstance(o, memoryview)
 * 
 */

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

/* "View.MemoryView":652
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
 */

static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
  PyObject *__pyx_v_tup = NULL;
  PyObject *__pyx_v_result = NULL;
  int __pyx_v_have_slices;
  int __pyx_v_seen_ellipsis;
  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
  PyObject *__pyx_v_item = NULL;
  Py_ssize_t __pyx_v_nslices;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("_unellipsify", 0);

  /* "View.MemoryView":657
 *     full slices.
 *     """
 *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
 *         tup = (index,)
 *     else:
 */
  __pyx_t_1 = PyTuple_Check(__pyx_v_index); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":658
 *     """
 *     if not isinstance(index, tuple):
 *         tup = (index,)             # <<<<<<<<<<<<<<
 *     else:
 *         tup = index
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __pyx_v_tup = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "View.MemoryView":657
 *     full slices.
 *     """
 *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
 *         tup = (index,)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":660
 *         tup = (index,)
 *     else:
 *         tup = index             # <<<<<<<<<<<<<<
 * 
 *     result = []
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_index);
    __pyx_v_tup = __pyx_v_index;
  }
  __pyx_L3:;

  /* "View.MemoryView":662
 *         tup = index
 * 
 *     result = []             # <<<<<<<<<<<<<<
 *     have_slices = False
 *     seen_ellipsis = False
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "View.MemoryView":663
 * 
 *     result = []
 *     have_slices = False             # <<<<<<<<<<<<<<
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):
 */
  __pyx_v_have_slices = 0;

  /* "View.MemoryView":664
 *     result = []
 *     have_slices = False
 *     seen_ellipsis = False             # <<<<<<<<<<<<<<
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:
 */
  __pyx_v_seen_ellipsis = 0;

  /* "View.MemoryView":665
 *     have_slices = False
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_3 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
    __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 665, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 665, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "View.MemoryView":666
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 */
    __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":667
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 *                 seen_ellipsis = True
 */
      __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
      if (__pyx_t_1) {

        /* "View.MemoryView":668
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
 *                 seen_ellipsis = True
 *             else:
 */
        __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __pyx_L1_error)
        __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        { Py_ssize_t __pyx_temp;
          for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
            __Pyx_INCREF(__pyx_slice__54);
            __Pyx_GIVEREF(__pyx_slice__54);
            PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__54);
          }
        }
        __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "View.MemoryView":669
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
 *             else:
 *                 result.append(slice(None))
 */
        __pyx_v_seen_ellipsis = 1;

        /* "View.MemoryView":667
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 *                 seen_ellipsis = True
 */
        goto __pyx_L7;
      }

      /* "View.MemoryView":671
 *                 seen_ellipsis = True
 *             else:
 *                 result.append(slice(None))             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
 */
      /*else*/ {
        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__55); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error)
      }
      __pyx_L7:;

      /* "View.MemoryView":672
 *             else:
 *                 result.append(slice(None))
 *             have_slices = True             # <<<<<<<<<<<<<<
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):
 */
      __pyx_v_have_slices = 1;

      /* "View.MemoryView":666
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 */
      goto __pyx_L6;
    }

    /* "View.MemoryView":674
 *             have_slices = True
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Cannot index with type '%s'" % type(item))
 * 
 */
    /*else*/ {
      __pyx_t_2 = PySlice_Check(__pyx_v_item); 
      __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_1 = __pyx_t_10;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
      __pyx_t_1 = __pyx_t_10;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_1) {

        /* "View.MemoryView":675
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):
 *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
 * 
 *             have_slices = have_slices or isinstance(item, slice)
 */
        __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(2, 675, __pyx_L1_error)

        /* "View.MemoryView":674
 *             have_slices = True
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Cannot index with type '%s'" % type(item))
 * 
 */
      }

      /* "View.MemoryView":677
 *                 raise TypeError("Cannot index with type '%s'" % type(item))
 * 
 *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
 *             result.append(item)
 * 
 */
      __pyx_t_10 = (__pyx_v_have_slices != 0);
      if (!__pyx_t_10) {
      } else {
        __pyx_t_1 = __pyx_t_10;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_10 = PySlice_Check(__pyx_v_item); 
      __pyx_t_2 = (__pyx_t_10 != 0);
      __pyx_t_1 = __pyx_t_2;
      __pyx_L11_bool_binop_done:;
      __pyx_v_have_slices = __pyx_t_1;

      /* "View.MemoryView":678
 * 
 *             have_slices = have_slices or isinstance(item, slice)
 *             result.append(item)             # <<<<<<<<<<<<<<
 * 
 *     nslices = ndim - len(result)
 */
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error)
    }
    __pyx_L6:;

    /* "View.MemoryView":665
 *     have_slices = False
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":680
 *             result.append(item)
 * 
 *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
 *     if nslices:
 *         result.extend([slice(None)] * nslices)
 */
  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error)
  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);

  /* "View.MemoryView":681
 * 
 *     nslices = ndim - len(result)
 *     if nslices:             # <<<<<<<<<<<<<<
 *         result.extend([slice(None)] * nslices)
 * 
 */
  __pyx_t_1 = (__pyx_v_nslices != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":682
 *     nslices = ndim - len(result)
 *     if nslices:
 *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
 * 
 *     return have_slices or nslices, tuple(result)
 */
    __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
        __Pyx_INCREF(__pyx_slice__56);
        __Pyx_GIVEREF(__pyx_slice__56);
        PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__56);
      }
    }
    __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "View.MemoryView":681
 * 
 *     nslices = ndim - len(result)
 *     if nslices:             # <<<<<<<<<<<<<<
 *         result.extend([slice(None)] * nslices)
 * 
 */
  }

  /* "View.MemoryView":684
 *         result.extend([slice(None)] * nslices)
 * 
 *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 */
  __Pyx_XDECREF(__pyx_r);
  if (!__pyx_v_have_slices) {
  } else {
    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_L14_bool_binop_done:;
  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":652
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":686
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 */

static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t *__pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);

  /* "View.MemoryView":687
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             raise ValueError("Indirect dimensions not supported")
 */
  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
    __pyx_t_1 = __pyx_t_3;
    __pyx_v_suboffset = (__pyx_t_1[0]);

    /* "View.MemoryView":688
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Indirect dimensions not supported")
 * 
 */
    __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
    if (__pyx_t_4) {

      /* "View.MemoryView":689
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(2, 689, __pyx_L1_error)

      /* "View.MemoryView":688
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Indirect dimensions not supported")
 * 
 */
    }
  }

  /* "View.MemoryView":686
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":696
 * 
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
 *     cdef bint negative_step
 */

static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
  int __pyx_v_new_ndim;
  int __pyx_v_suboffset_dim;
  int __pyx_v_dim;
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  __Pyx_memviewslice *__pyx_v_p_src;
  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
  __Pyx_memviewslice *__pyx_v_p_dst;
  int *__pyx_v_p_suboffset_dim;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  Py_ssize_t __pyx_v_step;
  int __pyx_v_have_start;
  int __pyx_v_have_stop;
  int __pyx_v_have_step;
  PyObject *__pyx_v_index = NULL;
  struct __pyx_memoryview_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_memoryview_obj *__pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  __Pyx_RefNannySetupContext("memview_slice", 0);

  /* "View.MemoryView":697
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
 *     cdef bint negative_step
 *     cdef __Pyx_memviewslice src, dst
 */
  __pyx_v_new_ndim = 0;
  __pyx_v_suboffset_dim = -1;

  /* "View.MemoryView":704
 * 
 * 
 *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
 * 
 *     cdef _memoryviewslice memviewsliceobj
 */
  memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));

  /* "View.MemoryView":708
 *     cdef _memoryviewslice memviewsliceobj
 * 
 *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(2, 708, __pyx_L1_error)
    }
  }
  #endif

  /* "View.MemoryView":710
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":711
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 */
    if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 711, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":712
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, &src)
 */
    __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);

    /* "View.MemoryView":710
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":714
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
 *         p_src = &src
 * 
 */
  /*else*/ {
    __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));

    /* "View.MemoryView":715
 *     else:
 *         slice_copy(memview, &src)
 *         p_src = &src             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_p_src = (&__pyx_v_src);
  }
  __pyx_L3:;

  /* "View.MemoryView":721
 * 
 * 
 *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
 *     dst.data = p_src.data
 * 
 */
  __pyx_t_4 = __pyx_v_p_src->memview;
  __pyx_v_dst.memview = __pyx_t_4;

  /* "View.MemoryView":722
 * 
 *     dst.memview = p_src.memview
 *     dst.data = p_src.data             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __pyx_v_p_src->data;
  __pyx_v_dst.data = __pyx_t_5;

  /* "View.MemoryView":727
 * 
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
 *     cdef int *p_suboffset_dim = &suboffset_dim
 *     cdef Py_ssize_t start, stop, step
 */
  __pyx_v_p_dst = (&__pyx_v_dst);

  /* "View.MemoryView":728
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst
 *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t start, stop, step
 *     cdef bint have_start, have_stop, have_step
 */
  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);

  /* "View.MemoryView":732
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             slice_memviewslice(
 */
  __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
    __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 732, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      }
    } else {
      __pyx_t_9 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 732, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_v_dim = __pyx_t_6;
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "View.MemoryView":733
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             slice_memviewslice(
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 */
    __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":737
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 */
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error)

      /* "View.MemoryView":734
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 */
      __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 734, __pyx_L1_error)

      /* "View.MemoryView":733
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             slice_memviewslice(
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 */
      goto __pyx_L6;
    }

    /* "View.MemoryView":740
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 */
    __pyx_t_2 = (__pyx_v_index == Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":741
 *                 False)
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 */
      (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;

      /* "View.MemoryView":742
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1
 */
      (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;

      /* "View.MemoryView":743
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
 *             new_ndim += 1
 *         else:
 */
      (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;

      /* "View.MemoryView":744
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 *         else:
 *             start = index.start or 0
 */
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);

      /* "View.MemoryView":740
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 */
      goto __pyx_L6;
    }

    /* "View.MemoryView":746
 *             new_ndim += 1
 *         else:
 *             start = index.start or 0             # <<<<<<<<<<<<<<
 *             stop = index.stop or 0
 *             step = index.step or 0
 */
    /*else*/ {
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error)
        __pyx_t_10 = __pyx_t_12;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_10 = 0;
      __pyx_L7_bool_binop_done:;
      __pyx_v_start = __pyx_t_10;

      /* "View.MemoryView":747
 *         else:
 *             start = index.start or 0
 *             stop = index.stop or 0             # <<<<<<<<<<<<<<
 *             step = index.step or 0
 * 
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error)
        __pyx_t_10 = __pyx_t_12;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_10 = 0;
      __pyx_L9_bool_binop_done:;
      __pyx_v_stop = __pyx_t_10;

      /* "View.MemoryView":748
 *             start = index.start or 0
 *             stop = index.stop or 0
 *             step = index.step or 0             # <<<<<<<<<<<<<<
 * 
 *             have_start = index.start is not None
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error)
        __pyx_t_10 = __pyx_t_12;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_10 = 0;
      __pyx_L11_bool_binop_done:;
      __pyx_v_step = __pyx_t_10;

      /* "View.MemoryView":750
 *             step = index.step or 0
 * 
 *             have_start = index.start is not None             # <<<<<<<<<<<<<<
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = (__pyx_t_9 != Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_have_start = __pyx_t_1;

      /* "View.MemoryView":751
 * 
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
 *             have_step = index.step is not None
 * 
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = (__pyx_t_9 != Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_have_stop = __pyx_t_1;

      /* "View.MemoryView":752
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None             # <<<<<<<<<<<<<<
 * 
 *             slice_memviewslice(
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = (__pyx_t_9 != Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_have_step = __pyx_t_1;

      /* "View.MemoryView":754
 *             have_step = index.step is not None
 * 
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 */
      __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 754, __pyx_L1_error)

      /* "View.MemoryView":760
 *                 have_start, have_stop, have_step,
 *                 True)
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
 */
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
    }
    __pyx_L6:;

    /* "View.MemoryView":732
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             slice_memviewslice(
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":762
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":763
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));

    /* "View.MemoryView":764
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_dtype_func,
 *                                     memview.dtype_is_object)
 */
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) }

    /* "View.MemoryView":765
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 *     else:
 */
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) }

    /* "View.MemoryView":763
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
 */
    __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 763, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":762
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 */
  }

  /* "View.MemoryView":768
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));

    /* "View.MemoryView":769
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
 *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "View.MemoryView":768
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
 */
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":696
 * 
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
 *     cdef bint negative_step
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":793
 * 
 * @cname('__pyx_memoryview_slice_memviewslice')
 * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
 *         __Pyx_memviewslice *dst,
 *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
 */

static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
  Py_ssize_t __pyx_v_new_shape;
  int __pyx_v_negative_step;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":813
 *     cdef bint negative_step
 * 
 *     if not is_slice:             # <<<<<<<<<<<<<<
 * 
 *         if start < 0:
 */
  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":815
 *     if not is_slice:
 * 
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start += shape
 *         if not 0 <= start < shape:
 */
    __pyx_t_1 = ((__pyx_v_start < 0) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":816
 * 
 *         if start < 0:
 *             start += shape             # <<<<<<<<<<<<<<
 *         if not 0 <= start < shape:
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
 */
      __pyx_v_start = (__pyx_v_start + __pyx_v_shape);

      /* "View.MemoryView":815
 *     if not is_slice:
 * 
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start += shape
 *         if not 0 <= start < shape:
 */
    }

    /* "View.MemoryView":817
 *         if start < 0:
 *             start += shape
 *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
 *     else:
 */
    __pyx_t_1 = (0 <= __pyx_v_start);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
    }
    __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":818
 *             start += shape
 *         if not 0 <= start < shape:
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
 *     else:
 * 
 */
      __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error)

      /* "View.MemoryView":817
 *         if start < 0:
 *             start += shape
 *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
 *     else:
 */
    }

    /* "View.MemoryView":813
 *     cdef bint negative_step
 * 
 *     if not is_slice:             # <<<<<<<<<<<<<<
 * 
 *         if start < 0:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":821
 *     else:
 * 
 *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
 * 
 *         if have_step and step == 0:
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_1 = ((__pyx_v_step < 0) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L6_bool_binop_done:;
    __pyx_v_negative_step = __pyx_t_2;

    /* "View.MemoryView":823
 *         negative_step = have_step != 0 and step < 0
 * 
 *         if have_step and step == 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
 * 
 */
    __pyx_t_1 = (__pyx_v_have_step != 0);
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_1 = ((__pyx_v_step == 0) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_2) {

      /* "View.MemoryView":824
 * 
 *         if have_step and step == 0:
 *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error)

      /* "View.MemoryView":823
 *         negative_step = have_step != 0 and step < 0
 * 
 *         if have_step and step == 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
 * 
 */
    }

    /* "View.MemoryView":827
 * 
 * 
 *         if have_start:             # <<<<<<<<<<<<<<
 *             if start < 0:
 *                 start += shape
 */
    __pyx_t_2 = (__pyx_v_have_start != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":828
 * 
 *         if have_start:
 *             if start < 0:             # <<<<<<<<<<<<<<
 *                 start += shape
 *                 if start < 0:
 */
      __pyx_t_2 = ((__pyx_v_start < 0) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":829
 *         if have_start:
 *             if start < 0:
 *                 start += shape             # <<<<<<<<<<<<<<
 *                 if start < 0:
 *                     start = 0
 */
        __pyx_v_start = (__pyx_v_start + __pyx_v_shape);

        /* "View.MemoryView":830
 *             if start < 0:
 *                 start += shape
 *                 if start < 0:             # <<<<<<<<<<<<<<
 *                     start = 0
 *             elif start >= shape:
 */
        __pyx_t_2 = ((__pyx_v_start < 0) != 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":831
 *                 start += shape
 *                 if start < 0:
 *                     start = 0             # <<<<<<<<<<<<<<
 *             elif start >= shape:
 *                 if negative_step:
 */
          __pyx_v_start = 0;

          /* "View.MemoryView":830
 *             if start < 0:
 *                 start += shape
 *                 if start < 0:             # <<<<<<<<<<<<<<
 *                     start = 0
 *             elif start >= shape:
 */
        }

        /* "View.MemoryView":828
 * 
 *         if have_start:
 *             if start < 0:             # <<<<<<<<<<<<<<
 *                 start += shape
 *                 if start < 0:
 */
        goto __pyx_L12;
      }

      /* "View.MemoryView":832
 *                 if start < 0:
 *                     start = 0
 *             elif start >= shape:             # <<<<<<<<<<<<<<
 *                 if negative_step:
 *                     start = shape - 1
 */
      __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":833
 *                     start = 0
 *             elif start >= shape:
 *                 if negative_step:             # <<<<<<<<<<<<<<
 *                     start = shape - 1
 *                 else:
 */
        __pyx_t_2 = (__pyx_v_negative_step != 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":834
 *             elif start >= shape:
 *                 if negative_step:
 *                     start = shape - 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     start = shape
 */
          __pyx_v_start = (__pyx_v_shape - 1);

          /* "View.MemoryView":833
 *                     start = 0
 *             elif start >= shape:
 *                 if negative_step:             # <<<<<<<<<<<<<<
 *                     start = shape - 1
 *                 else:
 */
          goto __pyx_L14;
        }

        /* "View.MemoryView":836
 *                     start = shape - 1
 *                 else:
 *                     start = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
        /*else*/ {
          __pyx_v_start = __pyx_v_shape;
        }
        __pyx_L14:;

        /* "View.MemoryView":832
 *                 if start < 0:
 *                     start = 0
 *             elif start >= shape:             # <<<<<<<<<<<<<<
 *                 if negative_step:
 *                     start = shape - 1
 */
      }
      __pyx_L12:;

      /* "View.MemoryView":827
 * 
 * 
 *         if have_start:             # <<<<<<<<<<<<<<
 *             if start < 0:
 *                 start += shape
 */
      goto __pyx_L11;
    }

    /* "View.MemoryView":838
 *                     start = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 start = shape - 1
 *             else:
 */
    /*else*/ {
      __pyx_t_2 = (__pyx_v_negative_step != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":839
 *         else:
 *             if negative_step:
 *                 start = shape - 1             # <<<<<<<<<<<<<<
 *             else:
 *                 start = 0
 */
        __pyx_v_start = (__pyx_v_shape - 1);

        /* "View.MemoryView":838
 *                     start = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 start = shape - 1
 *             else:
 */
        goto __pyx_L15;
      }

      /* "View.MemoryView":841
 *                 start = shape - 1
 *             else:
 *                 start = 0             # <<<<<<<<<<<<<<
 * 
 *         if have_stop:
 */
      /*else*/ {
        __pyx_v_start = 0;
      }
      __pyx_L15:;
    }
    __pyx_L11:;

    /* "View.MemoryView":843
 *                 start = 0
 * 
 *         if have_stop:             # <<<<<<<<<<<<<<
 *             if stop < 0:
 *                 stop += shape
 */
    __pyx_t_2 = (__pyx_v_have_stop != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":844
 * 
 *         if have_stop:
 *             if stop < 0:             # <<<<<<<<<<<<<<
 *                 stop += shape
 *                 if stop < 0:
 */
      __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":845
 *         if have_stop:
 *             if stop < 0:
 *                 stop += shape             # <<<<<<<<<<<<<<
 *                 if stop < 0:
 *                     stop = 0
 */
        __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);

        /* "View.MemoryView":846
 *             if stop < 0:
 *                 stop += shape
 *                 if stop < 0:             # <<<<<<<<<<<<<<
 *                     stop = 0
 *             elif stop > shape:
 */
        __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":847
 *                 stop += shape
 *                 if stop < 0:
 *                     stop = 0             # <<<<<<<<<<<<<<
 *             elif stop > shape:
 *                 stop = shape
 */
          __pyx_v_stop = 0;

          /* "View.MemoryView":846
 *             if stop < 0:
 *                 stop += shape
 *                 if stop < 0:             # <<<<<<<<<<<<<<
 *                     stop = 0
 *             elif stop > shape:
 */
        }

        /* "View.MemoryView":844
 * 
 *         if have_stop:
 *             if stop < 0:             # <<<<<<<<<<<<<<
 *                 stop += shape
 *                 if stop < 0:
 */
        goto __pyx_L17;
      }

      /* "View.MemoryView":848
 *                 if stop < 0:
 *                     stop = 0
 *             elif stop > shape:             # <<<<<<<<<<<<<<
 *                 stop = shape
 *         else:
 */
      __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":849
 *                     stop = 0
 *             elif stop > shape:
 *                 stop = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
        __pyx_v_stop = __pyx_v_shape;

        /* "View.MemoryView":848
 *                 if stop < 0:
 *                     stop = 0
 *             elif stop > shape:             # <<<<<<<<<<<<<<
 *                 stop = shape
 *         else:
 */
      }
      __pyx_L17:;

      /* "View.MemoryView":843
 *                 start = 0
 * 
 *         if have_stop:             # <<<<<<<<<<<<<<
 *             if stop < 0:
 *                 stop += shape
 */
      goto __pyx_L16;
    }

    /* "View.MemoryView":851
 *                 stop = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 stop = -1
 *             else:
 */
    /*else*/ {
      __pyx_t_2 = (__pyx_v_negative_step != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":852
 *         else:
 *             if negative_step:
 *                 stop = -1             # <<<<<<<<<<<<<<
 *             else:
 *                 stop = shape
 */
        __pyx_v_stop = -1L;

        /* "View.MemoryView":851
 *                 stop = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 stop = -1
 *             else:
 */
        goto __pyx_L19;
      }

      /* "View.MemoryView":854
 *                 stop = -1
 *             else:
 *                 stop = shape             # <<<<<<<<<<<<<<
 * 
 *         if not have_step:
 */
      /*else*/ {
        __pyx_v_stop = __pyx_v_shape;
      }
      __pyx_L19:;
    }
    __pyx_L16:;

    /* "View.MemoryView":856
 *                 stop = shape
 * 
 *         if not have_step:             # <<<<<<<<<<<<<<
 *             step = 1
 * 
 */
    __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":857
 * 
 *         if not have_step:
 *             step = 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_step = 1;

      /* "View.MemoryView":856
 *                 stop = shape
 * 
 *         if not have_step:             # <<<<<<<<<<<<<<
 *             step = 1
 * 
 */
    }

    /* "View.MemoryView":861
 * 
 *         with cython.cdivision(True):
 *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
 * 
 *             if (stop - start) - step * new_shape:
 */
    __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);

    /* "View.MemoryView":863
 *             new_shape = (stop - start) // step
 * 
 *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
 *                 new_shape += 1
 * 
 */
    __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":864
 * 
 *             if (stop - start) - step * new_shape:
 *                 new_shape += 1             # <<<<<<<<<<<<<<
 * 
 *         if new_shape < 0:
 */
      __pyx_v_new_shape = (__pyx_v_new_shape + 1);

      /* "View.MemoryView":863
 *             new_shape = (stop - start) // step
 * 
 *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
 *                 new_shape += 1
 * 
 */
    }

    /* "View.MemoryView":866
 *                 new_shape += 1
 * 
 *         if new_shape < 0:             # <<<<<<<<<<<<<<
 *             new_shape = 0
 * 
 */
    __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":867
 * 
 *         if new_shape < 0:
 *             new_shape = 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_new_shape = 0;

      /* "View.MemoryView":866
 *                 new_shape += 1
 * 
 *         if new_shape < 0:             # <<<<<<<<<<<<<<
 *             new_shape = 0
 * 
 */
    }

    /* "View.MemoryView":870
 * 
 * 
 *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset
 */
    (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);

    /* "View.MemoryView":871
 * 
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
 *         dst.suboffsets[new_ndim] = suboffset
 * 
 */
    (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;

    /* "View.MemoryView":872
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
  }
  __pyx_L3:;

  /* "View.MemoryView":875
 * 
 * 
 *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
 *         dst.data += start * stride
 *     else:
 */
  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":876
 * 
 *     if suboffset_dim[0] < 0:
 *         dst.data += start * stride             # <<<<<<<<<<<<<<
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 */
    __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));

    /* "View.MemoryView":875
 * 
 * 
 *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
 *         dst.data += start * stride
 *     else:
 */
    goto __pyx_L23;
  }

  /* "View.MemoryView":878
 *         dst.data += start * stride
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
 * 
 *     if suboffset >= 0:
 */
  /*else*/ {
    __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
    (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
  }
  __pyx_L23:;

  /* "View.MemoryView":880
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 * 
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         if not is_slice:
 *             if new_ndim == 0:
 */
  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":881
 * 
 *     if suboffset >= 0:
 *         if not is_slice:             # <<<<<<<<<<<<<<
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 */
    __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":882
 *     if suboffset >= 0:
 *         if not is_slice:
 *             if new_ndim == 0:             # <<<<<<<<<<<<<<
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":883
 *         if not is_slice:
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
 */
        __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);

        /* "View.MemoryView":882
 *     if suboffset >= 0:
 *         if not is_slice:
 *             if new_ndim == 0:             # <<<<<<<<<<<<<<
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 */
        goto __pyx_L26;
      }

      /* "View.MemoryView":885
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
 *                                      "must be indexed and not sliced", dim)
 *         else:
 */
      /*else*/ {

        /* "View.MemoryView":886
 *             else:
 *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
 *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
 *         else:
 *             suboffset_dim[0] = new_ndim
 */
        __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error)
      }
      __pyx_L26:;

      /* "View.MemoryView":881
 * 
 *     if suboffset >= 0:
 *         if not is_slice:             # <<<<<<<<<<<<<<
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 */
      goto __pyx_L25;
    }

    /* "View.MemoryView":888
 *                                      "must be indexed and not sliced", dim)
 *         else:
 *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
 * 
 *     return 0
 */
    /*else*/ {
      (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
    }
    __pyx_L25:;

    /* "View.MemoryView":880
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 * 
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         if not is_slice:
 *             if new_ndim == 0:
 */
  }

  /* "View.MemoryView":890
 *             suboffset_dim[0] = new_ndim
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":793
 * 
 * @cname('__pyx_memoryview_slice_memviewslice')
 * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
 *         __Pyx_memviewslice *dst,
 *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":896
 * 
 * @cname('__pyx_pybuffer_index')
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 */

static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
  Py_ssize_t __pyx_v_shape;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_suboffset;
  Py_ssize_t __pyx_v_itemsize;
  char *__pyx_v_resultp;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("pybuffer_index", 0);

  /* "View.MemoryView":898
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t itemsize = view.itemsize
 *     cdef char *resultp
 */
  __pyx_v_suboffset = -1L;

  /* "View.MemoryView":899
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
 *     cdef char *resultp
 * 
 */
  __pyx_t_1 = __pyx_v_view->itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":902
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len / itemsize
 *         stride = itemsize
 */
  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":903
 * 
 *     if view.ndim == 0:
 *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
 *         stride = itemsize
 *     else:
 */
    if (unlikely(__pyx_v_itemsize == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(2, 903, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(2, 903, __pyx_L1_error)
    }
    __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);

    /* "View.MemoryView":904
 *     if view.ndim == 0:
 *         shape = view.len / itemsize
 *         stride = itemsize             # <<<<<<<<<<<<<<
 *     else:
 *         shape = view.shape[dim]
 */
    __pyx_v_stride = __pyx_v_itemsize;

    /* "View.MemoryView":902
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len / itemsize
 *         stride = itemsize
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":906
 *         stride = itemsize
 *     else:
 *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 */
  /*else*/ {
    __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);

    /* "View.MemoryView":907
 *     else:
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]
 */
    __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);

    /* "View.MemoryView":908
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
 */
    __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":909
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
 * 
 *     if index < 0:
 */
      __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);

      /* "View.MemoryView":908
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
 */
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":911
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
 */
  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":912
 * 
 *     if index < 0:
 *         index += view.shape[dim]             # <<<<<<<<<<<<<<
 *         if index < 0:
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 */
    __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));

    /* "View.MemoryView":913
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
    __pyx_t_2 = ((__pyx_v_index < 0) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":914
 *         index += view.shape[dim]
 *         if index < 0:
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
 * 
 *     if index >= shape:
 */
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(2, 914, __pyx_L1_error)

      /* "View.MemoryView":913
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
    }

    /* "View.MemoryView":911
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
 */
  }

  /* "View.MemoryView":916
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":917
 * 
 *     if index >= shape:
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
 * 
 *     resultp = bufp + index * stride
 */
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 917, __pyx_L1_error)

    /* "View.MemoryView":916
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
  }

  /* "View.MemoryView":919
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset
 */
  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));

  /* "View.MemoryView":920
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 */
  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":921
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
 * 
 *     return resultp
 */
    __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);

    /* "View.MemoryView":920
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 */
  }

  /* "View.MemoryView":923
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 *     return resultp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_resultp;
  goto __pyx_L0;

  /* "View.MemoryView":896
 * 
 * @cname('__pyx_pybuffer_index')
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":929
 * 
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 */

static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
  int __pyx_v_ndim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  long __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;

  /* "View.MemoryView":930
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
 *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 */
  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
  __pyx_v_ndim = __pyx_t_1;

  /* "View.MemoryView":932
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t *strides = memslice.strides
 * 
 */
  __pyx_t_2 = __pyx_v_memslice->shape;
  __pyx_v_shape = __pyx_t_2;

  /* "View.MemoryView":933
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_v_memslice->strides;
  __pyx_v_strides = __pyx_t_2;

  /* "View.MemoryView":937
 * 
 *     cdef int i, j
 *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 */
  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":938
 *     cdef int i, j
 *     for i in range(ndim / 2):
 *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]
 */
    __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);

    /* "View.MemoryView":939
 *     for i in range(ndim / 2):
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 */
    __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]);
    __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]);
    (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
    (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;

    /* "View.MemoryView":940
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 */
    __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]);
    __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]);
    (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
    (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;

    /* "View.MemoryView":942
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 */
    __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_6) {

      /* "View.MemoryView":943
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
 * 
 *     return 1
 */
      __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error)

      /* "View.MemoryView":942
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 */
    }
  }

  /* "View.MemoryView":945
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 *     return 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "View.MemoryView":929
 * 
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":962
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 */

/* Python wrapper */
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

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

static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":963
 * 
 *     def __dealloc__(self):
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 */
  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);

  /* "View.MemoryView":962
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 */

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

/* "View.MemoryView":965
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
 */

static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":966
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":967
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":966
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
 */
  }

  /* "View.MemoryView":969
 *             return self.to_object_func(itemp)
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":965
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":971
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
 */

static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":972
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":973
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)
 */
    __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error)

    /* "View.MemoryView":972
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":975
 *             self.to_dtype_func(itemp, value)
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":971
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":978
 * 
 *     @property
 *     def base(self):             # <<<<<<<<<<<<<<
 *         return self.from_object
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":979
 *     @property
 *     def base(self):
 *         return self.from_object             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->from_object);
  __pyx_r = __pyx_v_self->from_object;
  goto __pyx_L0;

  /* "View.MemoryView":978
 * 
 *     @property
 *     def base(self):             # <<<<<<<<<<<<<<
 *         return self.from_object
 * 
 */

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

/* "View.MemoryView":985
 * 
 * @cname('__pyx_memoryview_fromslice')
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
 *                           int ndim,
 *                           object (*to_object_func)(char *),
 */

static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_TypeInfo *__pyx_t_4;
  Py_buffer __pyx_t_5;
  Py_ssize_t *__pyx_t_6;
  Py_ssize_t *__pyx_t_7;
  Py_ssize_t *__pyx_t_8;
  Py_ssize_t __pyx_t_9;
  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);

  /* "View.MemoryView":993
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":994
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "View.MemoryView":993
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  }

  /* "View.MemoryView":999
 * 
 * 
 *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     result.from_slice = memviewslice
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":1001
 *     result = _memoryviewslice(None, 0, dtype_is_object)
 * 
 *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 */
  __pyx_v_result->from_slice = __pyx_v_memviewslice;

  /* "View.MemoryView":1002
 * 
 *     result.from_slice = memviewslice
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base
 */
  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);

  /* "View.MemoryView":1004
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->from_object);
  __Pyx_DECREF(__pyx_v_result->from_object);
  __pyx_v_result->from_object = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":1005
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base
 *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
 * 
 *     result.view = memviewslice.memview.view
 */
  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;

  /* "View.MemoryView":1007
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 */
  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
  __pyx_v_result->__pyx_base.view = __pyx_t_5;

  /* "View.MemoryView":1008
 * 
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 */
  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);

  /* "View.MemoryView":1009
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)
 */
  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;

  /* "View.MemoryView":1010
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
 *     Py_INCREF(Py_None)
 * 
 */
  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;

  /* "View.MemoryView":1011
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     result.flags = PyBUF_RECORDS
 */
  Py_INCREF(Py_None);

  /* "View.MemoryView":1013
 *     Py_INCREF(Py_None)
 * 
 *     result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 */
  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;

  /* "View.MemoryView":1015
 *     result.flags = PyBUF_RECORDS
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
 * 
 */
  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);

  /* "View.MemoryView":1016
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);

  /* "View.MemoryView":1019
 * 
 * 
 *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
 */
  __pyx_v_result->__pyx_base.view.suboffsets = NULL;

  /* "View.MemoryView":1020
 * 
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 */
  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_v_suboffset = (__pyx_t_6[0]);

    /* "View.MemoryView":1021
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
 */
    __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":1022
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);

      /* "View.MemoryView":1023
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break             # <<<<<<<<<<<<<<
 * 
 *     result.view.len = result.view.itemsize
 */
      goto __pyx_L5_break;

      /* "View.MemoryView":1021
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
 */
    }
  }
  __pyx_L5_break:;

  /* "View.MemoryView":1025
 *             break
 * 
 *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length
 */
  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;

  /* "View.MemoryView":1026
 * 
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
 *         result.view.len *= length
 * 
 */
  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":1027
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length             # <<<<<<<<<<<<<<
 * 
 *     result.to_object_func = to_object_func
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1027, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
  }

  /* "View.MemoryView":1029
 *         result.view.len *= length
 * 
 *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
 *     result.to_dtype_func = to_dtype_func
 * 
 */
  __pyx_v_result->to_object_func = __pyx_v_to_object_func;

  /* "View.MemoryView":1030
 * 
 *     result.to_object_func = to_object_func
 *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;

  /* "View.MemoryView":1032
 *     result.to_dtype_func = to_dtype_func
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":985
 * 
 * @cname('__pyx_memoryview_fromslice')
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
 *                           int ndim,
 *                           object (*to_object_func)(char *),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1035
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
 *                                                    __Pyx_memviewslice *mslice):
 *     cdef _memoryviewslice obj
 */

static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
  __Pyx_memviewslice *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);

  /* "View.MemoryView":1038
 *                                                    __Pyx_memviewslice *mslice):
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1039
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview             # <<<<<<<<<<<<<<
 *         return &obj.from_slice
 *     else:
 */
    if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":1040
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview
 *         return &obj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, mslice)
 */
    __pyx_r = (&__pyx_v_obj->from_slice);
    goto __pyx_L0;

    /* "View.MemoryView":1038
 *                                                    __Pyx_memviewslice *mslice):
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
 */
  }

  /* "View.MemoryView":1042
 *         return &obj.from_slice
 *     else:
 *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
 *         return mslice
 * 
 */
  /*else*/ {
    __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);

    /* "View.MemoryView":1043
 *     else:
 *         slice_copy(memview, mslice)
 *         return mslice             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_slice_copy')
 */
    __pyx_r = __pyx_v_mslice;
    goto __pyx_L0;
  }

  /* "View.MemoryView":1035
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
 *                                                    __Pyx_memviewslice *mslice):
 *     cdef _memoryviewslice obj
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1046
 * 
 * @cname('__pyx_memoryview_slice_copy')
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
 *     cdef int dim
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 */

static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
  int __pyx_v_dim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  Py_ssize_t *__pyx_v_suboffsets;
  __Pyx_RefNannyDeclarations
  Py_ssize_t *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("slice_copy", 0);

  /* "View.MemoryView":1050
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 * 
 *     shape = memview.view.shape             # <<<<<<<<<<<<<<
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets
 */
  __pyx_t_1 = __pyx_v_memview->view.shape;
  __pyx_v_shape = __pyx_t_1;

  /* "View.MemoryView":1051
 * 
 *     shape = memview.view.shape
 *     strides = memview.view.strides             # <<<<<<<<<<<<<<
 *     suboffsets = memview.view.suboffsets
 * 
 */
  __pyx_t_1 = __pyx_v_memview->view.strides;
  __pyx_v_strides = __pyx_t_1;

  /* "View.MemoryView":1052
 *     shape = memview.view.shape
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 */
  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
  __pyx_v_suboffsets = __pyx_t_1;

  /* "View.MemoryView":1054
 *     suboffsets = memview.view.suboffsets
 * 
 *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
 *     dst.data = <char *> memview.view.buf
 * 
 */
  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);

  /* "View.MemoryView":1055
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
 * 
 *     for dim in range(memview.view.ndim):
 */
  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);

  /* "View.MemoryView":1057
 *     dst.data = <char *> memview.view.buf
 * 
 *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 */
  __pyx_t_2 = __pyx_v_memview->view.ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_dim = __pyx_t_3;

    /* "View.MemoryView":1058
 * 
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 */
    (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);

    /* "View.MemoryView":1059
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
 */
    (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);

    /* "View.MemoryView":1060
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object')
 */
    if ((__pyx_v_suboffsets != 0)) {
      __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
    } else {
      __pyx_t_4 = -1L;
    }
    (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
  }

  /* "View.MemoryView":1046
 * 
 * @cname('__pyx_memoryview_slice_copy')
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
 *     cdef int dim
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 */

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

/* "View.MemoryView":1063
 * 
 * @cname('__pyx_memoryview_copy_object')
 * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 */

static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
  __Pyx_memviewslice __pyx_v_memviewslice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("memoryview_copy", 0);

  /* "View.MemoryView":1066
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
 */
  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));

  /* "View.MemoryView":1067
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)
 *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1063
 * 
 * @cname('__pyx_memoryview_copy_object')
 * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1070
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
 *     """
 *     Create a new memoryview object from a given memoryview object and slice.
 */

static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
  PyObject *(*__pyx_v_to_object_func)(char *);
  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *(*__pyx_t_3)(char *);
  int (*__pyx_t_4)(char *, PyObject *);
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);

  /* "View.MemoryView":1077
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1078
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 */
    __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
    __pyx_v_to_object_func = __pyx_t_3;

    /* "View.MemoryView":1079
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
 *     else:
 *         to_object_func = NULL
 */
    __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
    __pyx_v_to_dtype_func = __pyx_t_4;

    /* "View.MemoryView":1077
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1081
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 *         to_object_func = NULL             # <<<<<<<<<<<<<<
 *         to_dtype_func = NULL
 * 
 */
  /*else*/ {
    __pyx_v_to_object_func = NULL;

    /* "View.MemoryView":1082
 *     else:
 *         to_object_func = NULL
 *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 */
    __pyx_v_to_dtype_func = NULL;
  }
  __pyx_L3:;

  /* "View.MemoryView":1084
 *         to_dtype_func = NULL
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "View.MemoryView":1086
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1070
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
 *     """
 *     Create a new memoryview object from a given memoryview object and slice.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1092
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
 *     if arg < 0:
 *         return -arg
 */

static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
  Py_ssize_t __pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":1093
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
 *     if arg < 0:             # <<<<<<<<<<<<<<
 *         return -arg
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1094
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
 *     if arg < 0:
 *         return -arg             # <<<<<<<<<<<<<<
 *     else:
 *         return arg
 */
    __pyx_r = (-__pyx_v_arg);
    goto __pyx_L0;

    /* "View.MemoryView":1093
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
 *     if arg < 0:             # <<<<<<<<<<<<<<
 *         return -arg
 *     else:
 */
  }

  /* "View.MemoryView":1096
 *         return -arg
 *     else:
 *         return arg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_get_best_slice_order')
 */
  /*else*/ {
    __pyx_r = __pyx_v_arg;
    goto __pyx_L0;
  }

  /* "View.MemoryView":1092
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
 *     if arg < 0:
 *         return -arg
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1099
 * 
 * @cname('__pyx_get_best_slice_order')
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Figure out the best memory access order for a given slice.
 */

static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_c_stride;
  Py_ssize_t __pyx_v_f_stride;
  char __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1104
 *     """
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t f_stride = 0
 * 
 */
  __pyx_v_c_stride = 0;

  /* "View.MemoryView":1105
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0
 *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
 */
  __pyx_v_f_stride = 0;

  /* "View.MemoryView":1107
 *     cdef Py_ssize_t f_stride = 0
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 */
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1108
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
 */
    __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1109
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1110
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
      goto __pyx_L4_break;

      /* "View.MemoryView":1108
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
 */
    }
  }
  __pyx_L4_break:;

  /* "View.MemoryView":1112
 *             break
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 */
  __pyx_t_1 = __pyx_v_ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1113
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
 */
    __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1114
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1115
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 */
      goto __pyx_L7_break;

      /* "View.MemoryView":1113
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
 */
    }
  }
  __pyx_L7_break:;

  /* "View.MemoryView":1117
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
 */
  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1118
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 *         return 'C'             # <<<<<<<<<<<<<<
 *     else:
 *         return 'F'
 */
    __pyx_r = 'C';
    goto __pyx_L0;

    /* "View.MemoryView":1117
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
 */
  }

  /* "View.MemoryView":1120
 *         return 'C'
 *     else:
 *         return 'F'             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
  /*else*/ {
    __pyx_r = 'F';
    goto __pyx_L0;
  }

  /* "View.MemoryView":1099
 * 
 * @cname('__pyx_get_best_slice_order')
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Figure out the best memory access order for a given slice.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1123
 * 
 * @cython.cdivision(True)
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
 *                                    char *dst_data, Py_ssize_t *dst_strides,
 *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
 */

static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
  Py_ssize_t __pyx_v_dst_extent;
  Py_ssize_t __pyx_v_src_stride;
  Py_ssize_t __pyx_v_dst_stride;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;

  /* "View.MemoryView":1130
 * 
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 */
  __pyx_v_src_extent = (__pyx_v_src_shape[0]);

  /* "View.MemoryView":1131
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 */
  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);

  /* "View.MemoryView":1132
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 */
  __pyx_v_src_stride = (__pyx_v_src_strides[0]);

  /* "View.MemoryView":1133
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
 */
  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);

  /* "View.MemoryView":1135
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 */
  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1136
 * 
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 */
    __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }

    /* "View.MemoryView":1137
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 *        else:
 */
    __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
    if (__pyx_t_2) {
      __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
    }
    __pyx_t_3 = (__pyx_t_2 != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;

    /* "View.MemoryView":1136
 * 
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 */
    if (__pyx_t_1) {

      /* "View.MemoryView":1138
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
 *        else:
 *            for i in range(dst_extent):
 */
      memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));

      /* "View.MemoryView":1136
 * 
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 */
      goto __pyx_L4;
    }

    /* "View.MemoryView":1140
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 *        else:
 *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride
 */
    /*else*/ {
      __pyx_t_4 = __pyx_v_dst_extent;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "View.MemoryView":1141
 *        else:
 *            for i in range(dst_extent):
 *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
 *                src_data += src_stride
 *                dst_data += dst_stride
 */
        memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);

        /* "View.MemoryView":1142
 *            for i in range(dst_extent):
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride             # <<<<<<<<<<<<<<
 *                dst_data += dst_stride
 *     else:
 */
        __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

        /* "View.MemoryView":1143
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride
 *                dst_data += dst_stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(dst_extent):
 */
        __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
      }
    }
    __pyx_L4:;

    /* "View.MemoryView":1135
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1145
 *                dst_data += dst_stride
 *     else:
 *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *             _copy_strided_to_strided(src_data, src_strides + 1,
 *                                      dst_data, dst_strides + 1,
 */
  /*else*/ {
    __pyx_t_4 = __pyx_v_dst_extent;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "View.MemoryView":1146
 *     else:
 *         for i in range(dst_extent):
 *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
 *                                      dst_data, dst_strides + 1,
 *                                      src_shape + 1, dst_shape + 1,
 */
      _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);

      /* "View.MemoryView":1150
 *                                      src_shape + 1, dst_shape + 1,
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride             # <<<<<<<<<<<<<<
 *             dst_data += dst_stride
 * 
 */
      __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

      /* "View.MemoryView":1151
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride
 *             dst_data += dst_stride             # <<<<<<<<<<<<<<
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
 */
      __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1123
 * 
 * @cython.cdivision(True)
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
 *                                    char *dst_data, Py_ssize_t *dst_strides,
 *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
 */

  /* function exit code */
}

/* "View.MemoryView":1153
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) nogil:
 */

static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {

  /* "View.MemoryView":1156
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) nogil:
 *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
 */
  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1153
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1160
 * 
 * @cname('__pyx_memoryview_slice_get_size')
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef int i
 */

static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_size;
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1163
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef int i
 *     cdef Py_ssize_t size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_size = __pyx_t_1;

  /* "View.MemoryView":1165
 *     cdef Py_ssize_t size = src.memview.view.itemsize
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         size *= src.shape[i]
 * 
 */
  __pyx_t_2 = __pyx_v_ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1166
 * 
 *     for i in range(ndim):
 *         size *= src.shape[i]             # <<<<<<<<<<<<<<
 * 
 *     return size
 */
    __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
  }

  /* "View.MemoryView":1168
 *         size *= src.shape[i]
 * 
 *     return size             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_fill_contig_strides_array')
 */
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "View.MemoryView":1160
 * 
 * @cname('__pyx_memoryview_slice_get_size')
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef int i
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1171
 * 
 * @cname('__pyx_fill_contig_strides_array')
 * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
 *                 int ndim, char order) nogil:
 */

static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1180
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
 */
  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1181
 * 
 *     if order == 'F':
 *         for idx in range(ndim):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride = stride * shape[idx]
 */
    __pyx_t_2 = __pyx_v_ndim;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_idx = __pyx_t_3;

      /* "View.MemoryView":1182
 *     if order == 'F':
 *         for idx in range(ndim):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride = stride * shape[idx]
 *     else:
 */
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1183
 *         for idx in range(ndim):
 *             strides[idx] = stride
 *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 */
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }

    /* "View.MemoryView":1180
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1185
 *             stride = stride * shape[idx]
 *     else:
 *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride = stride * shape[idx]
 */
  /*else*/ {
    for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) {
      __pyx_v_idx = __pyx_t_2;

      /* "View.MemoryView":1186
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride = stride * shape[idx]
 * 
 */
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1187
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride
 *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
 * 
 *     return stride
 */
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1189
 *             stride = stride * shape[idx]
 * 
 *     return stride             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 */
  __pyx_r = __pyx_v_stride;
  goto __pyx_L0;

  /* "View.MemoryView":1171
 * 
 * @cname('__pyx_fill_contig_strides_array')
 * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
 *                 int ndim, char order) nogil:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1192
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                              __Pyx_memviewslice *tmpslice,
 *                              char order,
 */

static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
  int __pyx_v_i;
  void *__pyx_v_result;
  size_t __pyx_v_itemsize;
  size_t __pyx_v_size;
  void *__pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_memoryview_obj *__pyx_t_4;
  int __pyx_t_5;

  /* "View.MemoryView":1203
 *     cdef void *result
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 */
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1204
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
 * 
 *     result = malloc(size)
 */
  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);

  /* "View.MemoryView":1206
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 *     result = malloc(size)             # <<<<<<<<<<<<<<
 *     if not result:
 *         _err(MemoryError, NULL)
 */
  __pyx_v_result = malloc(__pyx_v_size);

  /* "View.MemoryView":1207
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err(MemoryError, NULL)
 * 
 */
  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1208
 *     result = malloc(size)
 *     if not result:
 *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error)

    /* "View.MemoryView":1207
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err(MemoryError, NULL)
 * 
 */
  }

  /* "View.MemoryView":1211
 * 
 * 
 *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 */
  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);

  /* "View.MemoryView":1212
 * 
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 */
  __pyx_t_4 = __pyx_v_src->memview;
  __pyx_v_tmpslice->memview = __pyx_t_4;

  /* "View.MemoryView":1213
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1
 */
  __pyx_t_3 = __pyx_v_ndim;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "View.MemoryView":1214
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
 *         tmpslice.suboffsets[i] = -1
 * 
 */
    (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);

    /* "View.MemoryView":1215
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
 */
    (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
  }

  /* "View.MemoryView":1217
 *         tmpslice.suboffsets[i] = -1
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
 *                               ndim, order)
 * 
 */
  __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order);

  /* "View.MemoryView":1221
 * 
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0
 */
  __pyx_t_3 = __pyx_v_ndim;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "View.MemoryView":1222
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
 */
    __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1223
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
 * 
 *     if slice_is_contig(src[0], order, ndim):
 */
      (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;

      /* "View.MemoryView":1222
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
 */
    }
  }

  /* "View.MemoryView":1225
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
 */
  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1226
 * 
 *     if slice_is_contig(src[0], order, ndim):
 *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 */
    memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size);

    /* "View.MemoryView":1225
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
 */
    goto __pyx_L9;
  }

  /* "View.MemoryView":1228
 *         memcpy(result, src.data, size)
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  /*else*/ {
    copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
  }
  __pyx_L9:;

  /* "View.MemoryView":1230
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":1192
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                              __Pyx_memviewslice *tmpslice,
 *                              char order,
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1235
 * 
 * @cname('__pyx_memoryview_err_extents')
 * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
 */

static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err_extents", 0);

  /* "View.MemoryView":1238
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
 *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err_dim')
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;

  /* "View.MemoryView":1237
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
 *                                                         (i, extent1, extent2))
 * 
 */
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(2, 1237, __pyx_L1_error)

  /* "View.MemoryView":1235
 * 
 * @cname('__pyx_memoryview_err_extents')
 * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
 */

  /* 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("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1241
 * 
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise error(msg.decode('ascii') % dim)
 * 
 */

static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
  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;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err_dim", 0);
  __Pyx_INCREF(__pyx_v_error);

  /* "View.MemoryView":1242
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
 *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err')
 */
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_v_error);
  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(2, 1242, __pyx_L1_error)

  /* "View.MemoryView":1241
 * 
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise error(msg.decode('ascii') % dim)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1245
 * 
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))
 */

static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
  int __pyx_r;
  __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;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err", 0);
  __Pyx_INCREF(__pyx_v_error);

  /* "View.MemoryView":1246
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:
 *     if msg != NULL:             # <<<<<<<<<<<<<<
 *         raise error(msg.decode('ascii'))
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1247
 * cdef int _err(object error, char *msg) except -1 with gil:
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
 *     else:
 *         raise error
 */
    __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_error);
    __pyx_t_4 = __pyx_v_error; __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_ERR(2, 1247, __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_ERR(2, 1247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __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_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1247, __pyx_L1_error)

    /* "View.MemoryView":1246
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:
 *     if msg != NULL:             # <<<<<<<<<<<<<<
 *         raise error(msg.decode('ascii'))
 *     else:
 */
  }

  /* "View.MemoryView":1249
 *         raise error(msg.decode('ascii'))
 *     else:
 *         raise error             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_contents')
 */
  /*else*/ {
    __Pyx_Raise(__pyx_v_error, 0, 0, 0);
    __PYX_ERR(2, 1249, __pyx_L1_error)
  }

  /* "View.MemoryView":1245
 * 
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))
 */

  /* 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);
  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1252
 * 
 * @cname('__pyx_memoryview_copy_contents')
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice dst,
 *                                   int src_ndim, int dst_ndim,
 */

static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
  void *__pyx_v_tmpdata;
  size_t __pyx_v_itemsize;
  int __pyx_v_i;
  char __pyx_v_order;
  int __pyx_v_broadcasting;
  int __pyx_v_direct_copy;
  __Pyx_memviewslice __pyx_v_tmp;
  int __pyx_v_ndim;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  void *__pyx_t_6;
  int __pyx_t_7;

  /* "View.MemoryView":1260
 *     Check for overlapping memory and verify the shapes.
 *     """
 *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 */
  __pyx_v_tmpdata = NULL;

  /* "View.MemoryView":1261
 *     """
 *     cdef void *tmpdata = NULL
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 */
  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1263
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False
 */
  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);

  /* "View.MemoryView":1264
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
 *     cdef bint direct_copy = False
 *     cdef __Pyx_memviewslice tmp
 */
  __pyx_v_broadcasting = 0;

  /* "View.MemoryView":1265
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
 *     cdef __Pyx_memviewslice tmp
 * 
 */
  __pyx_v_direct_copy = 0;

  /* "View.MemoryView":1268
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 */
  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1269
 * 
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 */
    __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);

    /* "View.MemoryView":1268
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1270
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 */
  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1271
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)
 */
    __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);

    /* "View.MemoryView":1270
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 */
  }
  __pyx_L3:;

  /* "View.MemoryView":1273
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
  __pyx_t_3 = __pyx_v_dst_ndim;
  __pyx_t_4 = __pyx_v_src_ndim;
  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  __pyx_v_ndim = __pyx_t_5;

  /* "View.MemoryView":1275
 *     cdef int ndim = max(src_ndim, dst_ndim)
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 */
  __pyx_t_5 = __pyx_v_ndim;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1276
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 */
    __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1277
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
 */
      __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":1278
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 *                 broadcasting = True             # <<<<<<<<<<<<<<
 *                 src.strides[i] = 0
 *             else:
 */
        __pyx_v_broadcasting = 1;

        /* "View.MemoryView":1279
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 */
        (__pyx_v_src.strides[__pyx_v_i]) = 0;

        /* "View.MemoryView":1277
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
 */
        goto __pyx_L7;
      }

      /* "View.MemoryView":1281
 *                 src.strides[i] = 0
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
 * 
 *         if src.suboffsets[i] >= 0:
 */
      /*else*/ {
        __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1281, __pyx_L1_error)
      }
      __pyx_L7:;

      /* "View.MemoryView":1276
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 */
    }

    /* "View.MemoryView":1283
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 */
    __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1284
 * 
 *         if src.suboffsets[i] >= 0:
 *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 */
      __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error)

      /* "View.MemoryView":1283
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 */
    }
  }

  /* "View.MemoryView":1286
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(src, order, ndim):
 */
  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1288
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
 */
    __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1289
 * 
 *         if not slice_is_contig(src, order, ndim):
 *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 */
      __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);

      /* "View.MemoryView":1288
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
 */
    }

    /* "View.MemoryView":1291
 *             order = get_best_order(&dst, ndim)
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
 *         src = tmp
 * 
 */
    __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1291, __pyx_L1_error)
    __pyx_v_tmpdata = __pyx_t_6;

    /* "View.MemoryView":1292
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 *         src = tmp             # <<<<<<<<<<<<<<
 * 
 *     if not broadcasting:
 */
    __pyx_v_src = __pyx_v_tmp;

    /* "View.MemoryView":1286
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(src, order, ndim):
 */
  }

  /* "View.MemoryView":1294
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1297
 * 
 * 
 *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
 */
    __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1298
 * 
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
 *         elif slice_is_contig(src, 'F', ndim):
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 */
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);

      /* "View.MemoryView":1297
 * 
 * 
 *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
 */
      goto __pyx_L12;
    }

    /* "View.MemoryView":1299
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 */
    __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1300
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
 *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
 * 
 *         if direct_copy:
 */
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);

      /* "View.MemoryView":1299
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 */
    }
    __pyx_L12:;

    /* "View.MemoryView":1302
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 */
    __pyx_t_2 = (__pyx_v_direct_copy != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1304
 *         if direct_copy:
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 */
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

      /* "View.MemoryView":1305
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 *             free(tmpdata)
 */
      memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));

      /* "View.MemoryView":1306
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 *             free(tmpdata)
 *             return 0
 */
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

      /* "View.MemoryView":1307
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 *             free(tmpdata)             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
      free(__pyx_v_tmpdata);

      /* "View.MemoryView":1308
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 *             free(tmpdata)
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "View.MemoryView":1302
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 */
    }

    /* "View.MemoryView":1294
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  }

  /* "View.MemoryView":1310
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (__pyx_v_order == 'F');
  if (__pyx_t_2) {
    __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
  }
  __pyx_t_7 = (__pyx_t_2 != 0);
  if (__pyx_t_7) {

    /* "View.MemoryView":1313
 * 
 * 
 *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&dst)
 * 
 */
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error)

    /* "View.MemoryView":1314
 * 
 *         transpose_memslice(&src)
 *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 */
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error)

    /* "View.MemoryView":1310
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
 */
  }

  /* "View.MemoryView":1316
 *         transpose_memslice(&dst)
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 */
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1317
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 * 
 */
  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1318
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 * 
 *     free(tmpdata)
 */
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1320
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 * 
 *     free(tmpdata)             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  free(__pyx_v_tmpdata);

  /* "View.MemoryView":1321
 * 
 *     free(tmpdata)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1252
 * 
 * @cname('__pyx_memoryview_copy_contents')
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice dst,
 *                                   int src_ndim, int dst_ndim,
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1324
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
 *                             int ndim,
 *                             int ndim_other) nogil:
 */

static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
  int __pyx_v_i;
  int __pyx_v_offset;
  int __pyx_t_1;
  int __pyx_t_2;

  /* "View.MemoryView":1328
 *                             int ndim_other) nogil:
 *     cdef int i
 *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
 */
  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);

  /* "View.MemoryView":1330
 *     cdef int offset = ndim_other - ndim
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]
 */
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1331
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 */
    (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);

    /* "View.MemoryView":1332
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
 */
    (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);

    /* "View.MemoryView":1333
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(offset):
 */
    (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
  }

  /* "View.MemoryView":1335
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
 *     for i in range(offset):             # <<<<<<<<<<<<<<
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
 */
  __pyx_t_1 = __pyx_v_offset;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "View.MemoryView":1336
 * 
 *     for i in range(offset):
 *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1
 */
    (__pyx_v_mslice->shape[__pyx_v_i]) = 1;

    /* "View.MemoryView":1337
 *     for i in range(offset):
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i] = -1
 * 
 */
    (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);

    /* "View.MemoryView":1338
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
  }

  /* "View.MemoryView":1324
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
 *                             int ndim,
 *                             int ndim_other) nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1346
 * 
 * @cname('__pyx_memoryview_refcount_copying')
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
 *                            int ndim, bint inc) nogil:
 * 
 */

static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
  int __pyx_t_1;

  /* "View.MemoryView":1350
 * 
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
 *                                            dst.strides, ndim, inc)
 */
  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1351
 * 
 *     if dtype_is_object:
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
 *                                            dst.strides, ndim, inc)
 * 
 */
    __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);

    /* "View.MemoryView":1350
 * 
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
 *                                            dst.strides, ndim, inc)
 */
  }

  /* "View.MemoryView":1346
 * 
 * @cname('__pyx_memoryview_refcount_copying')
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
 *                            int ndim, bint inc) nogil:
 * 
 */

  /* function exit code */
}

/* "View.MemoryView":1355
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) with gil:
 */

static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);

  /* "View.MemoryView":1358
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) with gil:
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 */
  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);

  /* "View.MemoryView":1355
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) with gil:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "View.MemoryView":1361
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                     Py_ssize_t *strides, int ndim, bint inc):
 *     cdef Py_ssize_t i
 */

static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);

  /* "View.MemoryView":1365
 *     cdef Py_ssize_t i
 * 
 *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
 *         if ndim == 1:
 *             if inc:
 */
  __pyx_t_1 = (__pyx_v_shape[0]);
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "View.MemoryView":1366
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
 */
    __pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
    if (__pyx_t_3) {

      /* "View.MemoryView":1367
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 */
      __pyx_t_3 = (__pyx_v_inc != 0);
      if (__pyx_t_3) {

        /* "View.MemoryView":1368
 *         if ndim == 1:
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])
 */
        Py_INCREF((((PyObject **)__pyx_v_data)[0]));

        /* "View.MemoryView":1367
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 */
        goto __pyx_L6;
      }

      /* "View.MemoryView":1370
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1,
 */
      /*else*/ {
        Py_DECREF((((PyObject **)__pyx_v_data)[0]));
      }
      __pyx_L6:;

      /* "View.MemoryView":1366
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
 */
      goto __pyx_L5;
    }

    /* "View.MemoryView":1372
 *                 Py_DECREF((<PyObject **> data)[0])
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
 *                                       ndim - 1, inc)
 * 
 */
    /*else*/ {

      /* "View.MemoryView":1373
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1,
 *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
 * 
 *         data += strides[0]
 */
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
    }
    __pyx_L5:;

    /* "View.MemoryView":1375
 *                                       ndim - 1, inc)
 * 
 *         data += strides[0]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
  }

  /* "View.MemoryView":1361
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                     Py_ssize_t *strides, int ndim, bint inc):
 *     cdef Py_ssize_t i
 */

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

/* "View.MemoryView":1381
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) nogil:
 */

static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {

  /* "View.MemoryView":1384
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
 *                          itemsize, item)
 */
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1385
 *                               bint dtype_is_object) nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, False)
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
 *                          itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, True)
 */
  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);

  /* "View.MemoryView":1387
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
 *                          itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1381
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1391
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                               Py_ssize_t *strides, int ndim,
 *                               size_t itemsize, void *item) nogil:
 */

static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_extent;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;

  /* "View.MemoryView":1395
 *                               size_t itemsize, void *item) nogil:
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t extent = shape[0]
 * 
 */
  __pyx_v_stride = (__pyx_v_strides[0]);

  /* "View.MemoryView":1396
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]
 *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
 */
  __pyx_v_extent = (__pyx_v_shape[0]);

  /* "View.MemoryView":1398
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 */
  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1399
 * 
 *     if ndim == 1:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             memcpy(data, item, itemsize)
 *             data += stride
 */
    __pyx_t_2 = __pyx_v_extent;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "View.MemoryView":1400
 *     if ndim == 1:
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
 *             data += stride
 *     else:
 */
      memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);

      /* "View.MemoryView":1401
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 *             data += stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(extent):
 */
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }

    /* "View.MemoryView":1398
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1403
 *             data += stride
 *     else:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             _slice_assign_scalar(data, shape + 1, strides + 1,
 *                                 ndim - 1, itemsize, item)
 */
  /*else*/ {
    __pyx_t_2 = __pyx_v_extent;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "View.MemoryView":1404
 *     else:
 *         for i in range(extent):
 *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
 *                                 ndim - 1, itemsize, item)
 *             data += stride
 */
      __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);

      /* "View.MemoryView":1406
 *             _slice_assign_scalar(data, shape + 1, strides + 1,
 *                                 ndim - 1, itemsize, item)
 *             data += stride             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1391
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                               Py_ssize_t *strides, int ndim,
 *                               size_t itemsize, void *item) nogil:
 */

  /* function exit code */
}

static PyObject *__pyx_tp_new_9pylsewave_5cynum_cyVessel(PyTypeObject *t, PyObject *a, 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;
  if (unlikely(__pyx_pw_9pylsewave_5cynum_8cyVessel_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_9pylsewave_5cynum_cyVessel(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
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_9pylsewave_5cynum_8cyVessel_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_4name_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_L(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_1L_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_r_prox(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_6r_prox_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_r_dist(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_6r_dist_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_2id_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_w_th(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_4w_th_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_RLC(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_3RLC_1__get__(o);
}

static int __pyx_setprop_9pylsewave_5cynum_8cyVessel_RLC(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pylsewave_5cynum_8cyVessel_3RLC_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_dx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_2dx_1__get__(o);
}

static int __pyx_setprop_9pylsewave_5cynum_8cyVessel_dx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pylsewave_5cynum_8cyVessel_2dx_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_x(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_1x_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_r0(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_2r0_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_f_r0(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_4f_r0_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dr0(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_6df_dr0_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_5df_dx_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_f_r0_ph(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_7f_r0_ph_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dr0_ph(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_9df_dr0_ph_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dx_ph(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_8df_dx_ph_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_f_r0_mh(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_7f_r0_mh_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dr0_mh(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_9df_dr0_mh_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dx_mh(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_8df_dx_mh_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_8cyVessel_k(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_8cyVessel_1k_1__get__(o);
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cyVessel[] = {
  {"set_k_vector", (PyCFunction)__pyx_pw_9pylsewave_5cynum_8cyVessel_5set_k_vector, METH_O, 0},
  {"interpolate_R0", (PyCFunction)__pyx_pw_9pylsewave_5cynum_8cyVessel_7interpolate_R0, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9pylsewave_5cynum_cyVessel[] = {
  {(char *)"name", __pyx_getprop_9pylsewave_5cynum_8cyVessel_name, 0, (char *)0, 0},
  {(char *)"L", __pyx_getprop_9pylsewave_5cynum_8cyVessel_L, 0, (char *)0, 0},
  {(char *)"r_prox", __pyx_getprop_9pylsewave_5cynum_8cyVessel_r_prox, 0, (char *)0, 0},
  {(char *)"r_dist", __pyx_getprop_9pylsewave_5cynum_8cyVessel_r_dist, 0, (char *)0, 0},
  {(char *)"id", __pyx_getprop_9pylsewave_5cynum_8cyVessel_id, 0, (char *)0, 0},
  {(char *)"w_th", __pyx_getprop_9pylsewave_5cynum_8cyVessel_w_th, 0, (char *)0, 0},
  {(char *)"RLC", __pyx_getprop_9pylsewave_5cynum_8cyVessel_RLC, __pyx_setprop_9pylsewave_5cynum_8cyVessel_RLC, (char *)0, 0},
  {(char *)"dx", __pyx_getprop_9pylsewave_5cynum_8cyVessel_dx, __pyx_setprop_9pylsewave_5cynum_8cyVessel_dx, (char *)0, 0},
  {(char *)"x", __pyx_getprop_9pylsewave_5cynum_8cyVessel_x, 0, (char *)0, 0},
  {(char *)"r0", __pyx_getprop_9pylsewave_5cynum_8cyVessel_r0, 0, (char *)0, 0},
  {(char *)"f_r0", __pyx_getprop_9pylsewave_5cynum_8cyVessel_f_r0, 0, (char *)0, 0},
  {(char *)"df_dr0", __pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dr0, 0, (char *)0, 0},
  {(char *)"df_dx", __pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dx, 0, (char *)0, 0},
  {(char *)"f_r0_ph", __pyx_getprop_9pylsewave_5cynum_8cyVessel_f_r0_ph, 0, (char *)0, 0},
  {(char *)"df_dr0_ph", __pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dr0_ph, 0, (char *)0, 0},
  {(char *)"df_dx_ph", __pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dx_ph, 0, (char *)0, 0},
  {(char *)"f_r0_mh", __pyx_getprop_9pylsewave_5cynum_8cyVessel_f_r0_mh, 0, (char *)0, 0},
  {(char *)"df_dr0_mh", __pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dr0_mh, 0, (char *)0, 0},
  {(char *)"df_dx_mh", __pyx_getprop_9pylsewave_5cynum_8cyVessel_df_dx_mh, 0, (char *)0, 0},
  {(char *)"k", __pyx_getprop_9pylsewave_5cynum_8cyVessel_k, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cyVessel = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cyVessel", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cyVessel), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cyVessel, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cyVessel, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9pylsewave_5cynum_cyVessel, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cyVessel, /*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 PyObject *__pyx_tp_new_9pylsewave_5cynum_cyVesselScaled(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cyVessel(t, a, k);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_9pylsewave_5cynum_14cyVesselScaled_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_9pylsewave_5cynum_cyVesselScaled(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
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_9pylsewave_5cynum_14cyVesselScaled_5__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_9pylsewave_5cynum_cyVessel(o);
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cyVesselScaled[] = {
  {"set_k_vector", (PyCFunction)__pyx_pw_9pylsewave_5cynum_14cyVesselScaled_3set_k_vector, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cyVesselScaled = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cyVesselScaled", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cyVesselScaled), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cyVesselScaled, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cyVesselScaled, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cyVesselScaled, /*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 PyObject *__pyx_tp_new_9pylsewave_5cynum_cyVesselNetwork(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *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_9pylsewave_5cynum_cyVesselNetwork *)o);
  p->_vessels = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_9pylsewave_5cynum_cyVesselNetwork(PyObject *o) {
  struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *p = (struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)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);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_vessels);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_9pylsewave_5cynum_cyVesselNetwork(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *p = (struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)o;
  if (p->_vessels) {
    e = (*v)(p->_vessels, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_9pylsewave_5cynum_cyVesselNetwork(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *p = (struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork *)o;
  tmp = ((PyObject*)p->_vessels);
  p->_vessels = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_vessels(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_7vessels_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_dx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2dx_1__get__(o);
}

static int __pyx_setprop_9pylsewave_5cynum_15cyVesselNetwork_dx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2dx_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_p0(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2p0_1__get__(o);
}

static int __pyx_setprop_9pylsewave_5cynum_15cyVesselNetwork_p0(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2p0_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_Re(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2Re_1__get__(o);
}

static int __pyx_setprop_9pylsewave_5cynum_15cyVesselNetwork_Re(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_2Re_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_rho(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_3rho_1__get__(o);
}

static int __pyx_setprop_9pylsewave_5cynum_15cyVesselNetwork_rho(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_3rho_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_delta(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_5delta_1__get__(o);
}

static int __pyx_setprop_9pylsewave_5cynum_15cyVesselNetwork_delta(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pylsewave_5cynum_15cyVesselNetwork_5delta_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cyVesselNetwork[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9pylsewave_5cynum_cyVesselNetwork[] = {
  {(char *)"vessels", __pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_vessels, 0, (char *)0, 0},
  {(char *)"dx", __pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_dx, __pyx_setprop_9pylsewave_5cynum_15cyVesselNetwork_dx, (char *)0, 0},
  {(char *)"p0", __pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_p0, __pyx_setprop_9pylsewave_5cynum_15cyVesselNetwork_p0, (char *)0, 0},
  {(char *)"Re", __pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_Re, __pyx_setprop_9pylsewave_5cynum_15cyVesselNetwork_Re, (char *)0, 0},
  {(char *)"rho", __pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_rho, __pyx_setprop_9pylsewave_5cynum_15cyVesselNetwork_rho, (char *)0, 0},
  {(char *)"delta", __pyx_getprop_9pylsewave_5cynum_15cyVesselNetwork_delta, __pyx_setprop_9pylsewave_5cynum_15cyVesselNetwork_delta, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cyVesselNetwork = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cyVesselNetwork", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetwork), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cyVesselNetwork, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cyVesselNetwork, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cyVesselNetwork, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cyVesselNetwork, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9pylsewave_5cynum_cyVesselNetwork, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cyVesselNetwork, /*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 PyObject *__pyx_tp_new_9pylsewave_5cynum_cyVesselNetworkSc(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cyVesselNetwork(t, a, k);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_9pylsewave_5cynum_17cyVesselNetworkSc_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_9pylsewave_5cynum_cyVesselNetworkSc(PyObject *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);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_9pylsewave_5cynum_17cyVesselNetworkSc_5__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_9pylsewave_5cynum_cyVesselNetwork(o);
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cyVesselNetworkSc[] = {
  {"set_boundary_layer_th", (PyCFunction)__pyx_pw_9pylsewave_5cynum_17cyVesselNetworkSc_3set_boundary_layer_th, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cyVesselNetworkSc = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cyVesselNetworkSc", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cyVesselNetworkSc), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cyVesselNetworkSc, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cyVesselNetwork, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cyVesselNetwork, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cyVesselNetworkSc, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cyVesselNetworkSc, /*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_9pylsewave_5cynum_cPDEm __pyx_vtable_9pylsewave_5cynum_cPDEm;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_cPDEm(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_cPDEm *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_9pylsewave_5cynum_cPDEm *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pylsewave_5cynum_cPDEm;
  new((void*)&(p->vessels)) std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel> ();
  p->mesh = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_9pylsewave_5cynum_cPDEm(PyObject *o) {
  struct __pyx_obj_9pylsewave_5cynum_cPDEm *p = (struct __pyx_obj_9pylsewave_5cynum_cPDEm *)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);
  __Pyx_call_destructor(p->vessels);
  Py_CLEAR(p->mesh);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_9pylsewave_5cynum_cPDEm(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_9pylsewave_5cynum_cPDEm *p = (struct __pyx_obj_9pylsewave_5cynum_cPDEm *)o;
  if (p->mesh) {
    e = (*v)(p->mesh, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_9pylsewave_5cynum_cPDEm(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_9pylsewave_5cynum_cPDEm *p = (struct __pyx_obj_9pylsewave_5cynum_cPDEm *)o;
  tmp = ((PyObject*)p->mesh);
  p->mesh = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_5cPDEm_delta(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_5cPDEm_5delta_1__get__(o);
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_5cPDEm_mesh(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_5cPDEm_4mesh_1__get__(o);
}

static int __pyx_setprop_9pylsewave_5cynum_5cPDEm_mesh(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pylsewave_5cynum_5cPDEm_4mesh_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cPDEm[] = {
  {"set_boundary_layer_th", (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_3set_boundary_layer_th, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_5cPDEm_2set_boundary_layer_th},
  {"set_vessels", (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_5set_vessels, METH_VARARGS|METH_KEYWORDS, 0},
  {"flux_i", (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_7flux_i, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_5cPDEm_6flux_i},
  {"source_i", (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_9source_i, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_5cPDEm_8source_i},
  {"compute_c_i", (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_11compute_c_i, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_5cPDEm_10compute_c_i},
  {"compute_c", (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cPDEm_13compute_c, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_5cPDEm_12compute_c},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9pylsewave_5cynum_cPDEm[] = {
  {(char *)"delta", __pyx_getprop_9pylsewave_5cynum_5cPDEm_delta, 0, (char *)0, 0},
  {(char *)"mesh", __pyx_getprop_9pylsewave_5cynum_5cPDEm_mesh, __pyx_setprop_9pylsewave_5cynum_5cPDEm_mesh, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cPDEm = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cPDEm", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cPDEm), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cPDEm, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    .. math::\n\n        \\frac{\\partial U}{\\partial t} + \\frac{\\partial F}{\\partial x} = S(U)\n\n    :param pylsewave.mesh.VesselNetwork mesh: the vessel network\n    :param float rho: the density of fluid medium (e.g. blood, water, etc.)\n    :param float mu: blood viscosity\n    :param float Re: the Reynolds number\n    ", /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cPDEm, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cPDEm, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cPDEm, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9pylsewave_5cynum_cPDEm, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_9pylsewave_5cynum_5cPDEm_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cPDEm, /*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_9pylsewave_5cynum_cPDEsWat __pyx_vtable_9pylsewave_5cynum_cPDEsWat;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_cPDEsWat(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *p;
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cPDEm(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pylsewave_5cynum_cPDEsWat *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm*)__pyx_vtabptr_9pylsewave_5cynum_cPDEsWat;
  return o;
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cPDEsWat[] = {
  {"compute_c_i", (PyCFunction)__pyx_pw_9pylsewave_5cynum_8cPDEsWat_1compute_c_i, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_8cPDEsWat_compute_c_i},
  {"compute_c", (PyCFunction)__pyx_pw_9pylsewave_5cynum_8cPDEsWat_3compute_c, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_8cPDEsWat_2compute_c},
  {"flux_i", (PyCFunction)__pyx_pw_9pylsewave_5cynum_8cPDEsWat_5flux_i, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_8cPDEsWat_4flux_i},
  {"source_i", (PyCFunction)__pyx_pw_9pylsewave_5cynum_8cPDEsWat_7source_i, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_8cPDEsWat_6source_i},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cPDEsWat = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cPDEsWat", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cPDEsWat), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cPDEm, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cPDEm, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cPDEm, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cPDEsWat, /*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_9pylsewave_5cynum_5cPDEm_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cPDEsWat, /*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_9pylsewave_5cynum_cPDEsWatVisco __pyx_vtable_9pylsewave_5cynum_cPDEsWatVisco;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_cPDEsWatVisco(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *p;
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cPDEsWat(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm*)__pyx_vtabptr_9pylsewave_5cynum_cPDEsWatVisco;
  return o;
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cPDEsWatVisco[] = {
  {"set_vessels", (PyCFunction)__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_1set_vessels, METH_VARARGS|METH_KEYWORDS, 0},
  {"pressure_visco", (PyCFunction)__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_3pressure_visco, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_13cPDEsWatVisco_2pressure_visco},
  {"CV_f", (PyCFunction)__pyx_pw_9pylsewave_5cynum_13cPDEsWatVisco_5CV_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_13cPDEsWatVisco_4CV_f},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cPDEsWatVisco = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cPDEsWatVisco", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cPDEm, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    PDEs class to discretise a system with visco-elastic properties.\n\n    ..note:: see Watanabe at al.\n    ", /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cPDEm, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cPDEm, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cPDEsWatVisco, /*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_9pylsewave_5cynum_5cPDEm_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cPDEsWatVisco, /*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_9pylsewave_5cynum_PDEmCs __pyx_vtable_9pylsewave_5cynum_PDEmCs;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_PDEmCs(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_PDEmCs *p;
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cPDEm(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pylsewave_5cynum_PDEmCs *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pylsewave_5cynum_cPDEm*)__pyx_vtabptr_9pylsewave_5cynum_PDEmCs;
  return o;
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_6PDEmCs_mesh(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_6PDEmCs_4mesh_1__get__(o);
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_PDEmCs[] = {
  {"flux_i", (PyCFunction)__pyx_pw_9pylsewave_5cynum_6PDEmCs_1flux_i, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_6PDEmCs_flux_i},
  {"source_i", (PyCFunction)__pyx_pw_9pylsewave_5cynum_6PDEmCs_3source_i, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_6PDEmCs_2source_i},
  {"compute_c_i", (PyCFunction)__pyx_pw_9pylsewave_5cynum_6PDEmCs_5compute_c_i, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_6PDEmCs_4compute_c_i},
  {"compute_c", (PyCFunction)__pyx_pw_9pylsewave_5cynum_6PDEmCs_7compute_c, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pylsewave_5cynum_6PDEmCs_6compute_c},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9pylsewave_5cynum_PDEmCs[] = {
  {(char *)"mesh", __pyx_getprop_9pylsewave_5cynum_6PDEmCs_mesh, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_PDEmCs = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.PDEmCs", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_PDEmCs), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cPDEm, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cPDEm, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cPDEm, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_PDEmCs, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9pylsewave_5cynum_PDEmCs, /*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_9pylsewave_5cynum_5cPDEm_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_PDEmCs, /*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_9pylsewave_5cynum_cBCs __pyx_vtable_9pylsewave_5cynum_cBCs;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_cBCs(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_cBCs *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_9pylsewave_5cynum_cBCs *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pylsewave_5cynum_cBCs;
  new((void*)&(p->vessels)) std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel> ();
  p->pdes = ((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)Py_None); Py_INCREF(Py_None);
  p->mesh = Py_None; Py_INCREF(Py_None);
  p->inlet_fun = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_9pylsewave_5cynum_cBCs(PyObject *o) {
  struct __pyx_obj_9pylsewave_5cynum_cBCs *p = (struct __pyx_obj_9pylsewave_5cynum_cBCs *)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);
  __Pyx_call_destructor(p->vessels);
  Py_CLEAR(p->pdes);
  Py_CLEAR(p->mesh);
  Py_CLEAR(p->inlet_fun);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_9pylsewave_5cynum_cBCs(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_9pylsewave_5cynum_cBCs *p = (struct __pyx_obj_9pylsewave_5cynum_cBCs *)o;
  if (p->pdes) {
    e = (*v)(((PyObject*)p->pdes), a); if (e) return e;
  }
  if (p->mesh) {
    e = (*v)(p->mesh, a); if (e) return e;
  }
  if (p->inlet_fun) {
    e = (*v)(p->inlet_fun, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_9pylsewave_5cynum_cBCs(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_9pylsewave_5cynum_cBCs *p = (struct __pyx_obj_9pylsewave_5cynum_cBCs *)o;
  tmp = ((PyObject*)p->pdes);
  p->pdes = ((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->mesh);
  p->mesh = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->inlet_fun);
  p->inlet_fun = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cBCs[] = {
  {"U_0", (PyCFunction)__pyx_pw_9pylsewave_5cynum_4cBCs_3U_0, METH_VARARGS|METH_KEYWORDS, 0},
  {"I", (PyCFunction)__pyx_pw_9pylsewave_5cynum_4cBCs_5I, METH_VARARGS|METH_KEYWORDS, 0},
  {"conjuction_R", (PyCFunction)__pyx_pw_9pylsewave_5cynum_4cBCs_7conjuction_R, METH_VARARGS|METH_KEYWORDS, 0},
  {"conjuction_Jr", (PyCFunction)__pyx_pw_9pylsewave_5cynum_4cBCs_9conjuction_Jr, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cBCs = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cBCs", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cBCs), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cBCs, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Class to set boundary conditions. Inlet, outlet, bifs and conjs.\n\n    :param pylsewave.cynum.cPDEm inpdes: the discretised system of pdes.\n    :param inletfunc: a python function for inlet BCs.\n    ", /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cBCs, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cBCs, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cBCs, /*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_9pylsewave_5cynum_4cBCs_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cBCs, /*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_9pylsewave_5cynum_cBCsWat __pyx_vtable_9pylsewave_5cynum_cBCsWat;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_cBCsWat(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_cBCsWat *p;
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cBCs(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pylsewave_5cynum_cBCsWat *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs*)__pyx_vtabptr_9pylsewave_5cynum_cBCsWat;
  return o;
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cBCsWat[] = {
  {"U_0", (PyCFunction)__pyx_pw_9pylsewave_5cynum_7cBCsWat_1U_0, METH_VARARGS|METH_KEYWORDS, 0},
  {"conjuction_R", (PyCFunction)__pyx_pw_9pylsewave_5cynum_7cBCsWat_3conjuction_R, METH_VARARGS|METH_KEYWORDS, 0},
  {"conjuction_Jr", (PyCFunction)__pyx_pw_9pylsewave_5cynum_7cBCsWat_5conjuction_Jr, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cBCsWat = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cBCsWat", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cBCsWat), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cBCs, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cBCs, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cBCs, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cBCsWat, /*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_9pylsewave_5cynum_4cBCs_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cBCsWat, /*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_9pylsewave_5cynum_BCsSc __pyx_vtable_9pylsewave_5cynum_BCsSc;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_BCsSc(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_BCsSc *p;
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cBCs(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pylsewave_5cynum_BCsSc *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs*)__pyx_vtabptr_9pylsewave_5cynum_BCsSc;
  return o;
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_BCsSc[] = {
  {"conjuction_R", (PyCFunction)__pyx_pw_9pylsewave_5cynum_5BCsSc_1conjuction_R, METH_VARARGS|METH_KEYWORDS, 0},
  {"conjuction_Jr", (PyCFunction)__pyx_pw_9pylsewave_5cynum_5BCsSc_3conjuction_Jr, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_BCsSc = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.BCsSc", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_BCsSc), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cBCs, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cBCs, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cBCs, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_BCsSc, /*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_9pylsewave_5cynum_4cBCs_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_BCsSc, /*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_9pylsewave_5cynum_BCsD __pyx_vtable_9pylsewave_5cynum_BCsD;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_BCsD(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_BCsD *p;
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cBCs(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pylsewave_5cynum_BCsD *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs*)__pyx_vtabptr_9pylsewave_5cynum_BCsD;
  return o;
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_BCsD[] = {
  {"U_0", (PyCFunction)__pyx_pw_9pylsewave_5cynum_4BCsD_1U_0, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_BCsD = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.BCsD", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_BCsD), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cBCs, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cBCs, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cBCs, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_BCsD, /*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_9pylsewave_5cynum_4cBCs_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_BCsD, /*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_9pylsewave_5cynum_BCsADAN56 __pyx_vtable_9pylsewave_5cynum_BCsADAN56;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_BCsADAN56(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_BCsADAN56 *p;
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cBCsWat(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pylsewave_5cynum_BCsADAN56 *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs*)__pyx_vtabptr_9pylsewave_5cynum_BCsADAN56;
  return o;
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_BCsADAN56[] = {
  {"U_0", (PyCFunction)__pyx_pw_9pylsewave_5cynum_9BCsADAN56_1U_0, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_BCsADAN56 = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.BCsADAN56", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_BCsADAN56), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cBCs, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cBCs, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cBCs, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_BCsADAN56, /*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_9pylsewave_5cynum_4cBCs_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_BCsADAN56, /*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_9pylsewave_5cynum_cBCsHandModelNonReflBcs __pyx_vtable_9pylsewave_5cynum_cBCsHandModelNonReflBcs;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_cBCsHandModelNonReflBcs(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_cBCsHandModelNonReflBcs *p;
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cBCsWat(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pylsewave_5cynum_cBCsHandModelNonReflBcs *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pylsewave_5cynum_cBCs*)__pyx_vtabptr_9pylsewave_5cynum_cBCsHandModelNonReflBcs;
  return o;
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cBCsHandModelNonReflBcs[] = {
  {"U_0", (PyCFunction)__pyx_pw_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_1U_0, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cBCsHandModelNonReflBcs = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cBCsHandModelNonReflBcs", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cBCsHandModelNonReflBcs), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cBCs, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cBCs, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cBCs, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cBCsHandModelNonReflBcs, /*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_9pylsewave_5cynum_4cBCs_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cBCsHandModelNonReflBcs, /*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_9pylsewave_5cynum_cFDMSolver __pyx_vtable_9pylsewave_5cynum_cFDMSolver;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_cFDMSolver(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *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_9pylsewave_5cynum_cFDMSolver *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pylsewave_5cynum_cFDMSolver;
  p->mesh = Py_None; Py_INCREF(Py_None);
  p->_pdes = ((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)Py_None); Py_INCREF(Py_None);
  p->_bcs = ((struct __pyx_obj_9pylsewave_5cynum_cBCs *)Py_None); Py_INCREF(Py_None);
  p->_t.data = NULL;
  p->_t.memview = NULL;
  p->U0_arr.data = NULL;
  p->U0_arr.memview = NULL;
  p->UL_arr.data = NULL;
  p->UL_arr.memview = NULL;
  p->_It.data = NULL;
  p->_It.memview = NULL;
  p->UBif_arr.data = NULL;
  p->UBif_arr.memview = NULL;
  p->UConj_arr.data = NULL;
  p->UConj_arr.memview = NULL;
  return o;
}

static void __pyx_tp_dealloc_9pylsewave_5cynum_cFDMSolver(PyObject *o) {
  struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *p = (struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)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->mesh);
  Py_CLEAR(p->_pdes);
  Py_CLEAR(p->_bcs);
  __PYX_XDEC_MEMVIEW(&p->_t, 1);
  __PYX_XDEC_MEMVIEW(&p->U0_arr, 1);
  __PYX_XDEC_MEMVIEW(&p->UL_arr, 1);
  __PYX_XDEC_MEMVIEW(&p->_It, 1);
  __PYX_XDEC_MEMVIEW(&p->UBif_arr, 1);
  __PYX_XDEC_MEMVIEW(&p->UConj_arr, 1);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_9pylsewave_5cynum_cFDMSolver(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *p = (struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)o;
  if (p->mesh) {
    e = (*v)(p->mesh, a); if (e) return e;
  }
  if (p->_pdes) {
    e = (*v)(((PyObject*)p->_pdes), a); if (e) return e;
  }
  if (p->_bcs) {
    e = (*v)(((PyObject*)p->_bcs), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_9pylsewave_5cynum_cFDMSolver(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *p = (struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *)o;
  tmp = ((PyObject*)p->mesh);
  p->mesh = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pdes);
  p->_pdes = ((struct __pyx_obj_9pylsewave_5cynum_cPDEm *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_bcs);
  p->_bcs = ((struct __pyx_obj_9pylsewave_5cynum_cBCs *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_9pylsewave_5cynum_10cFDMSolver_mesh(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pylsewave_5cynum_10cFDMSolver_4mesh_1__get__(o);
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cFDMSolver[] = {
  {"set_T", (PyCFunction)__pyx_pw_9pylsewave_5cynum_10cFDMSolver_3set_T, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_BC", (PyCFunction)__pyx_pw_9pylsewave_5cynum_10cFDMSolver_5set_BC, METH_VARARGS|METH_KEYWORDS, 0},
  {"solve", (PyCFunction)__pyx_pw_9pylsewave_5cynum_10cFDMSolver_7solve, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9pylsewave_5cynum_cFDMSolver[] = {
  {(char *)"mesh", __pyx_getprop_9pylsewave_5cynum_10cFDMSolver_mesh, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cFDMSolver = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cFDMSolver", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cFDMSolver, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Base class for finite-difference computing schemes.\n    ", /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cFDMSolver, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cFDMSolver, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cFDMSolver, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9pylsewave_5cynum_cFDMSolver, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_9pylsewave_5cynum_10cFDMSolver_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cFDMSolver, /*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_9pylsewave_5cynum_cLaxWendroffSolver __pyx_vtable_9pylsewave_5cynum_cLaxWendroffSolver;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_cLaxWendroffSolver(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_cLaxWendroffSolver *p;
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cFDMSolver(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pylsewave_5cynum_cLaxWendroffSolver *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver*)__pyx_vtabptr_9pylsewave_5cynum_cLaxWendroffSolver;
  return o;
}

static PyTypeObject __pyx_type_9pylsewave_5cynum_cLaxWendroffSolver = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cLaxWendroffSolver", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cLaxWendroffSolver), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cFDMSolver, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n\n    Class with 2 step Lax-Wendroff scheme.\n\n    .. math::\n\n        U_i^{n+1} = U_i^{n} - \\frac{\\Delta t}{\\Delta x} \\left( F_{i + \\frac{1}{2}}^{n + \\frac{1}{2}}\n         - F_{i - \\frac{1}{2}}^{n + \\frac{1}{2}} \\right) +\n          \\frac{\\Delta t}{2}\\left( S_{i + \\frac{1}{2}}^{n + \\frac{1}{2}}\n           + S_{i - \\frac{1}{2}}^{n + \\frac{1}{2}} \\right)\n\n    where the intermediate values calculated as\n\n    .. math::\n\n        U_j^{n+\\frac{1}{2}} = \\frac{U_{j+1/2}^n + U_{j-1/2}^n}{2}\n         - \\frac{\\Delta t}{2 \\Delta x}\\left( F_{j+1/2} - F_{j-1/2} \\right)\n          + \\frac{\\Delta t}{4}\\left( S_{j+1/2} + S_{j-1/2}  \\right)\n\n    ", /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cFDMSolver, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cFDMSolver, /*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_9pylsewave_5cynum_10cFDMSolver_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cLaxWendroffSolver, /*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_9pylsewave_5cynum_cMacCormackSolver __pyx_vtable_9pylsewave_5cynum_cMacCormackSolver;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_cMacCormackSolver(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_cMacCormackSolver *p;
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cFDMSolver(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pylsewave_5cynum_cMacCormackSolver *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver*)__pyx_vtabptr_9pylsewave_5cynum_cMacCormackSolver;
  return o;
}

static PyTypeObject __pyx_type_9pylsewave_5cynum_cMacCormackSolver = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cMacCormackSolver", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cMacCormackSolver), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cFDMSolver, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Class with the MacCormack scheme implementation.\n\n    .. math::\n\n        U_i^{\\star} = U_i^n - \\frac{\\Delta t}{\\Delta x}\\left( F_{i+1}^n -\n         F_i^n \\right) + \\Delta t S_i^n\n\n\n\n    and\n\n    .. math::\n\n        U_i^{n+1} = \\frac{1}{2}\\left( U_i^n + U_i^{\\star} \\right)\n         - \\frac{\\Delta t}{2 \\Delta x}\\left( F_i^{\\star}\n          - F_{i-1}^{\\star} \\right) + \\frac{\\Delta t}{2}S_i^{\\star}\n\n    ", /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cFDMSolver, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cFDMSolver, /*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_9pylsewave_5cynum_10cFDMSolver_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cMacCormackSolver, /*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_9pylsewave_5cynum_cMacCormackGodunovSplitSolver __pyx_vtable_9pylsewave_5cynum_cMacCormackGodunovSplitSolver;

static PyObject *__pyx_tp_new_9pylsewave_5cynum_cMacCormackGodunovSplitSolver(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *p;
  PyObject *o = __pyx_tp_new_9pylsewave_5cynum_cMacCormackSolver(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pylsewave_5cynum_cFDMSolver*)__pyx_vtabptr_9pylsewave_5cynum_cMacCormackGodunovSplitSolver;
  return o;
}

static PyMethodDef __pyx_methods_9pylsewave_5cynum_cMacCormackGodunovSplitSolver[] = {
  {"_advance_Godunov_splitting", (PyCFunction)__pyx_pw_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_1_advance_Godunov_splitting, METH_VARARGS|METH_KEYWORDS, 0},
  {"solve", (PyCFunction)__pyx_pw_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_3solve, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pylsewave_5cynum_cMacCormackGodunovSplitSolver = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.cMacCormackGodunovSplitSolver", /*tp_name*/
  sizeof(struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pylsewave_5cynum_cFDMSolver, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Solve U_t + F_x = S\n    ", /*tp_doc*/
  __pyx_tp_traverse_9pylsewave_5cynum_cFDMSolver, /*tp_traverse*/
  __pyx_tp_clear_9pylsewave_5cynum_cFDMSolver, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pylsewave_5cynum_cMacCormackGodunovSplitSolver, /*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_9pylsewave_5cynum_10cFDMSolver_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pylsewave_5cynum_cMacCormackGodunovSplitSolver, /*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_array __pyx_vtable_array;

static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_array_obj *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_array_obj *)o);
  p->__pyx_vtab = __pyx_vtabptr_array;
  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_array(PyObject *o) {
  struct __pyx_array_obj *p = (struct __pyx_array_obj *)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
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_array___dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mode);
  Py_CLEAR(p->_format);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_array___setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
  PyObject *v = PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_array___getattr__(o, n);
  }
  return v;
}

static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}

static PyMethodDef __pyx_methods_array[] = {
  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_array[] = {
  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_array = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_array, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_array = {
  0, /*mp_length*/
  __pyx_array___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_array = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_array_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.array", /*tp_name*/
  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_array, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  __pyx_tp_getattro_array, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_array, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_array, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_array, /*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 PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_MemviewEnum_obj *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_MemviewEnum_obj *)o);
  p->name = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_Enum(PyObject *o) {
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)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->name);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  if (p->name) {
    e = (*v)(p->name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_Enum(PyObject *o) {
  PyObject* tmp;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  tmp = ((PyObject*)p->name);
  p->name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_Enum[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type___pyx_MemviewEnum = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.Enum", /*tp_name*/
  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_MemviewEnum___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*/
  0, /*tp_doc*/
  __pyx_tp_traverse_Enum, /*tp_traverse*/
  __pyx_tp_clear_Enum, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_Enum, /*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_MemviewEnum___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_Enum, /*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_memoryview __pyx_vtable_memoryview;

static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryview_obj *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_memoryview_obj *)o);
  p->__pyx_vtab = __pyx_vtabptr_memoryview;
  p->obj = Py_None; Py_INCREF(Py_None);
  p->_size = Py_None; Py_INCREF(Py_None);
  p->_array_interface = Py_None; Py_INCREF(Py_None);
  p->view.obj = NULL;
  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_memoryview(PyObject *o) {
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)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);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_memoryview___dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->obj);
  Py_CLEAR(p->_size);
  Py_CLEAR(p->_array_interface);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  if (p->obj) {
    e = (*v)(p->obj, a); if (e) return e;
  }
  if (p->_size) {
    e = (*v)(p->_size, a); if (e) return e;
  }
  if (p->_array_interface) {
    e = (*v)(p->_array_interface, a); if (e) return e;
  }
  if (p->view.obj) {
    e = (*v)(p->view.obj, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_memoryview(PyObject *o) {
  PyObject* tmp;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  tmp = ((PyObject*)p->obj);
  p->obj = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_size);
  p->_size = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_array_interface);
  p->_array_interface = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  Py_CLEAR(p->view.obj);
  return 0;
}
static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_memoryview___setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}

static PyMethodDef __pyx_methods_memoryview[] = {
  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_memoryview[] = {
  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
  __pyx_memoryview___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_memoryview, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
  __pyx_memoryview___len__, /*mp_length*/
  __pyx_memoryview___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_memoryview = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum.memoryview", /*tp_name*/
  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_memoryview___repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_memoryview___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_memoryview, /*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*/
  0, /*tp_doc*/
  __pyx_tp_traverse_memoryview, /*tp_traverse*/
  __pyx_tp_clear_memoryview, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_memoryview, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_memoryview, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_memoryview, /*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__memoryviewslice __pyx_vtable__memoryviewslice;

static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryviewslice_obj *p;
  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_memoryviewslice_obj *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
  p->from_object = Py_None; Py_INCREF(Py_None);
  p->from_slice.memview = NULL;
  return o;
}

static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)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);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_memoryviewslice___dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->from_object);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_memoryview(o);
}

static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
  if (p->from_object) {
    e = (*v)(p->from_object, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
  PyObject* tmp;
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  __pyx_tp_clear_memoryview(o);
  tmp = ((PyObject*)p->from_object);
  p->from_object = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
  return 0;
}

static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}

static PyMethodDef __pyx_methods__memoryviewslice[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type___pyx_memoryviewslice = {
  PyVarObject_HEAD_INIT(0, 0)
  "pylsewave.cynum._memoryviewslice", /*tp_name*/
  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview___repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview___str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  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*/
  "Internal class for passing memoryview slices to Python", /*tp_doc*/
  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods__memoryviewslice, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets__memoryviewslice, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new__memoryviewslice, /*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[] = {
  {"pystd_dev", (PyCFunction)__pyx_pw_9pylsewave_5cynum_1pystd_dev, METH_O, 0},
  {"pytdma", (PyCFunction)__pyx_pw_9pylsewave_5cynum_3pytdma, METH_VARARGS|METH_KEYWORDS, 0},
  {"cpwgrad", (PyCFunction)__pyx_pw_9pylsewave_5cynum_5cpwgrad, METH_VARARGS|METH_KEYWORDS, 0},
  {"norm2", (PyCFunction)__pyx_pw_9pylsewave_5cynum_9norm2, METH_O, 0},
  {"dotVec", (PyCFunction)__pyx_pw_9pylsewave_5cynum_11dotVec, METH_VARARGS|METH_KEYWORDS, 0},
  {"linear_extrapolation", (PyCFunction)__pyx_pw_9pylsewave_5cynum_13linear_extrapolation, 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
    "cynum",
    __pyx_k_This_is_a_Cython_file_with_clas, /* 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_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
  {&__pyx_n_s_CV_f, __pyx_k_CV_f, sizeof(__pyx_k_CV_f), 0, 0, 1, 1},
  {&__pyx_kp_s_C_gitRepositories_github_pylsewa, __pyx_k_C_gitRepositories_github_pylsewa, sizeof(__pyx_k_C_gitRepositories_github_pylsewa), 0, 0, 1, 0},
  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
  {&__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_Georgios_E_Ragkousis, __pyx_k_Georgios_E_Ragkousis, sizeof(__pyx_k_Georgios_E_Ragkousis), 0, 0, 1, 0},
  {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1},
  {&__pyx_n_s_Id, __pyx_k_Id, sizeof(__pyx_k_Id), 0, 0, 1, 1},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at, __pyx_k_No_value_specified_for_struct_at, sizeof(__pyx_k_No_value_specified_for_struct_at), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_10, __pyx_k_No_value_specified_for_struct_at_10, sizeof(__pyx_k_No_value_specified_for_struct_at_10), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_11, __pyx_k_No_value_specified_for_struct_at_11, sizeof(__pyx_k_No_value_specified_for_struct_at_11), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_12, __pyx_k_No_value_specified_for_struct_at_12, sizeof(__pyx_k_No_value_specified_for_struct_at_12), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_13, __pyx_k_No_value_specified_for_struct_at_13, sizeof(__pyx_k_No_value_specified_for_struct_at_13), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_14, __pyx_k_No_value_specified_for_struct_at_14, sizeof(__pyx_k_No_value_specified_for_struct_at_14), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_15, __pyx_k_No_value_specified_for_struct_at_15, sizeof(__pyx_k_No_value_specified_for_struct_at_15), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_16, __pyx_k_No_value_specified_for_struct_at_16, sizeof(__pyx_k_No_value_specified_for_struct_at_16), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_17, __pyx_k_No_value_specified_for_struct_at_17, sizeof(__pyx_k_No_value_specified_for_struct_at_17), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_18, __pyx_k_No_value_specified_for_struct_at_18, sizeof(__pyx_k_No_value_specified_for_struct_at_18), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_19, __pyx_k_No_value_specified_for_struct_at_19, sizeof(__pyx_k_No_value_specified_for_struct_at_19), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_2, __pyx_k_No_value_specified_for_struct_at_2, sizeof(__pyx_k_No_value_specified_for_struct_at_2), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_20, __pyx_k_No_value_specified_for_struct_at_20, sizeof(__pyx_k_No_value_specified_for_struct_at_20), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_21, __pyx_k_No_value_specified_for_struct_at_21, sizeof(__pyx_k_No_value_specified_for_struct_at_21), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_22, __pyx_k_No_value_specified_for_struct_at_22, sizeof(__pyx_k_No_value_specified_for_struct_at_22), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_23, __pyx_k_No_value_specified_for_struct_at_23, sizeof(__pyx_k_No_value_specified_for_struct_at_23), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_3, __pyx_k_No_value_specified_for_struct_at_3, sizeof(__pyx_k_No_value_specified_for_struct_at_3), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_4, __pyx_k_No_value_specified_for_struct_at_4, sizeof(__pyx_k_No_value_specified_for_struct_at_4), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_5, __pyx_k_No_value_specified_for_struct_at_5, sizeof(__pyx_k_No_value_specified_for_struct_at_5), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_6, __pyx_k_No_value_specified_for_struct_at_6, sizeof(__pyx_k_No_value_specified_for_struct_at_6), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_7, __pyx_k_No_value_specified_for_struct_at_7, sizeof(__pyx_k_No_value_specified_for_struct_at_7), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_8, __pyx_k_No_value_specified_for_struct_at_8, sizeof(__pyx_k_No_value_specified_for_struct_at_8), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_9, __pyx_k_No_value_specified_for_struct_at_9, sizeof(__pyx_k_No_value_specified_for_struct_at_9), 0, 0, 1, 0},
  {&__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_Nx, __pyx_k_Nx, sizeof(__pyx_k_Nx), 0, 0, 1, 1},
  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
  {&__pyx_n_s_PRINT_STATUS, __pyx_k_PRINT_STATUS, sizeof(__pyx_k_PRINT_STATUS), 0, 0, 1, 1},
  {&__pyx_n_s_RLC, __pyx_k_RLC, sizeof(__pyx_k_RLC), 0, 0, 1, 1},
  {&__pyx_n_s_R_dist, __pyx_k_R_dist, sizeof(__pyx_k_R_dist), 0, 0, 1, 1},
  {&__pyx_n_s_R_prox, __pyx_k_R_prox, sizeof(__pyx_k_R_prox), 0, 0, 1, 1},
  {&__pyx_n_s_Re, __pyx_k_Re, sizeof(__pyx_k_Re), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_kp_s_Solver_failed_in_vessel_d_in_tim, __pyx_k_Solver_failed_in_vessel_d_in_tim, sizeof(__pyx_k_Solver_failed_in_vessel_d_in_tim), 0, 0, 1, 0},
  {&__pyx_kp_s_Solver_set_to_dt_0_9f, __pyx_k_Solver_set_to_dt_0_9f, sizeof(__pyx_k_Solver_set_to_dt_0_9f), 0, 0, 1, 0},
  {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_U0_array, __pyx_k_U0_array, sizeof(__pyx_k_U0_array), 0, 0, 1, 1},
  {&__pyx_n_s_UBif_array, __pyx_k_UBif_array, sizeof(__pyx_k_UBif_array), 0, 0, 1, 1},
  {&__pyx_n_s_UConj_array, __pyx_k_UConj_array, sizeof(__pyx_k_UConj_array), 0, 0, 1, 1},
  {&__pyx_n_s_UL_array, __pyx_k_UL_array, sizeof(__pyx_k_UL_array), 0, 0, 1, 1},
  {&__pyx_n_s_U_0, __pyx_k_U_0, sizeof(__pyx_k_U_0), 0, 0, 1, 1},
  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_WRITE_STATUS, __pyx_k_WRITE_STATUS, sizeof(__pyx_k_WRITE_STATUS), 0, 0, 1, 1},
  {&__pyx_n_s_Wall_th, __pyx_k_Wall_th, sizeof(__pyx_k_Wall_th), 0, 0, 1, 1},
  {&__pyx_n_s_Windk, __pyx_k_Windk, sizeof(__pyx_k_Windk), 0, 0, 1, 1},
  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
  {&__pyx_n_s_a_mh, __pyx_k_a_mh, sizeof(__pyx_k_a_mh), 0, 0, 1, 1},
  {&__pyx_n_s_a_ph, __pyx_k_a_ph, sizeof(__pyx_k_a_ph), 0, 0, 1, 1},
  {&__pyx_n_s_advance_Godunov_splitting, __pyx_k_advance_Godunov_splitting, sizeof(__pyx_k_advance_Godunov_splitting), 0, 0, 1, 1},
  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
  {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_bcs, __pyx_k_bcs, sizeof(__pyx_k_bcs), 0, 0, 1, 1},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_clms, __pyx_k_clms, sizeof(__pyx_k_clms), 0, 0, 1, 1},
  {&__pyx_n_s_clock, __pyx_k_clock, sizeof(__pyx_k_clock), 0, 0, 1, 1},
  {&__pyx_n_s_compute_c, __pyx_k_compute_c, sizeof(__pyx_k_compute_c), 0, 0, 1, 1},
  {&__pyx_n_s_compute_c_i, __pyx_k_compute_c_i, sizeof(__pyx_k_compute_c_i), 0, 0, 1, 1},
  {&__pyx_n_s_conjuction_Jr, __pyx_k_conjuction_Jr, sizeof(__pyx_k_conjuction_Jr), 0, 0, 1, 1},
  {&__pyx_n_s_conjuction_R, __pyx_k_conjuction_R, sizeof(__pyx_k_conjuction_R), 0, 0, 1, 1},
  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
  {&__pyx_n_s_cwrite2file, __pyx_k_cwrite2file, sizeof(__pyx_k_cwrite2file), 0, 0, 1, 1},
  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
  {&__pyx_n_s_df_dr0, __pyx_k_df_dr0, sizeof(__pyx_k_df_dr0), 0, 0, 1, 1},
  {&__pyx_n_s_df_dr0_mh, __pyx_k_df_dr0_mh, sizeof(__pyx_k_df_dr0_mh), 0, 0, 1, 1},
  {&__pyx_n_s_df_dr0_ph, __pyx_k_df_dr0_ph, sizeof(__pyx_k_df_dr0_ph), 0, 0, 1, 1},
  {&__pyx_n_s_df_dx, __pyx_k_df_dx, sizeof(__pyx_k_df_dx), 0, 0, 1, 1},
  {&__pyx_n_s_df_dx_mh, __pyx_k_df_dx_mh, sizeof(__pyx_k_df_dx_mh), 0, 0, 1, 1},
  {&__pyx_n_s_df_dx_ph, __pyx_k_df_dx_ph, sizeof(__pyx_k_df_dx_ph), 0, 0, 1, 1},
  {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
  {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_n_s_f_r0, __pyx_k_f_r0, sizeof(__pyx_k_f_r0), 0, 0, 1, 1},
  {&__pyx_n_s_f_r0_mh, __pyx_k_f_r0_mh, sizeof(__pyx_k_f_r0_mh), 0, 0, 1, 1},
  {&__pyx_n_s_f_r0_ph, __pyx_k_f_r0_ph, sizeof(__pyx_k_f_r0_ph), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
  {&__pyx_n_s_flux_i, __pyx_k_flux_i, sizeof(__pyx_k_flux_i), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_inarr, __pyx_k_inarr, sizeof(__pyx_k_inarr), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_inletfunc, __pyx_k_inletfunc, sizeof(__pyx_k_inletfunc), 0, 0, 1, 1},
  {&__pyx_n_s_inpdes, __pyx_k_inpdes, sizeof(__pyx_k_inpdes), 0, 0, 1, 1},
  {&__pyx_n_s_input_v, __pyx_k_input_v, sizeof(__pyx_k_input_v), 0, 0, 1, 1},
  {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  {&__pyx_n_s_interpolate_R0, __pyx_k_interpolate_R0, sizeof(__pyx_k_interpolate_R0), 0, 0, 1, 1},
  {&__pyx_n_s_interpolate_R0m, __pyx_k_interpolate_R0m, sizeof(__pyx_k_interpolate_R0m), 0, 0, 1, 1},
  {&__pyx_n_s_interpolate_R0p, __pyx_k_interpolate_R0p, sizeof(__pyx_k_interpolate_R0p), 0, 0, 1, 1},
  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
  {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_linspace, __pyx_k_linspace, sizeof(__pyx_k_linspace), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
  {&__pyx_n_s_mesh, __pyx_k_mesh, sizeof(__pyx_k_mesh), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_s_mu, __pyx_k_mu, sizeof(__pyx_k_mu), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 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_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
  {&__pyx_n_s_no_cycles, __pyx_k_no_cycles, sizeof(__pyx_k_no_cycles), 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_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
  {&__pyx_n_s_out_c, __pyx_k_out_c, sizeof(__pyx_k_out_c), 0, 0, 1, 1},
  {&__pyx_n_s_out_f, __pyx_k_out_f, sizeof(__pyx_k_out_f), 0, 0, 1, 1},
  {&__pyx_n_s_out_p, __pyx_k_out_p, sizeof(__pyx_k_out_p), 0, 0, 1, 1},
  {&__pyx_n_s_out_s, __pyx_k_out_s, sizeof(__pyx_k_out_s), 0, 0, 1, 1},
  {&__pyx_n_s_p0, __pyx_k_p0, sizeof(__pyx_k_p0), 0, 0, 1, 1},
  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
  {&__pyx_n_s_parStruct, __pyx_k_parStruct, sizeof(__pyx_k_parStruct), 0, 0, 1, 1},
  {&__pyx_n_s_phi, __pyx_k_phi, sizeof(__pyx_k_phi), 0, 0, 1, 1},
  {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},
  {&__pyx_n_s_power, __pyx_k_power, sizeof(__pyx_k_power), 0, 0, 1, 1},
  {&__pyx_n_s_pressure_visco, __pyx_k_pressure_visco, sizeof(__pyx_k_pressure_visco), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_pylsewave_cynum, __pyx_k_pylsewave_cynum, sizeof(__pyx_k_pylsewave_cynum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 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_qc, __pyx_k_qc, sizeof(__pyx_k_qc), 0, 0, 1, 1},
  {&__pyx_n_s_r0, __pyx_k_r0, sizeof(__pyx_k_r0), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1},
  {&__pyx_n_s_rho, __pyx_k_rho, sizeof(__pyx_k_rho), 0, 0, 1, 1},
  {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
  {&__pyx_n_s_rws, __pyx_k_rws, sizeof(__pyx_k_rws), 0, 0, 1, 1},
  {&__pyx_n_s_set_BC, __pyx_k_set_BC, sizeof(__pyx_k_set_BC), 0, 0, 1, 1},
  {&__pyx_n_s_set_T, __pyx_k_set_T, sizeof(__pyx_k_set_T), 0, 0, 1, 1},
  {&__pyx_n_s_set_boundary_layer_th, __pyx_k_set_boundary_layer_th, sizeof(__pyx_k_set_boundary_layer_th), 0, 0, 1, 1},
  {&__pyx_n_s_set_vessels, __pyx_k_set_vessels, sizeof(__pyx_k_set_vessels), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_siz, __pyx_k_siz, sizeof(__pyx_k_siz), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_skip_frame, __pyx_k_skip_frame, sizeof(__pyx_k_skip_frame), 0, 0, 1, 1},
  {&__pyx_n_s_solve, __pyx_k_solve, sizeof(__pyx_k_solve), 0, 0, 1, 1},
  {&__pyx_n_s_source_i, __pyx_k_source_i, sizeof(__pyx_k_source_i), 0, 0, 1, 1},
  {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
  {&__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_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
  {&__pyx_n_s_user_action, __pyx_k_user_action, sizeof(__pyx_k_user_action), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 0, 1, 1},
  {&__pyx_n_s_vectorV, __pyx_k_vectorV, sizeof(__pyx_k_vectorV), 0, 0, 1, 1},
  {&__pyx_n_s_vectorised, __pyx_k_vectorised, sizeof(__pyx_k_vectorised), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_vessel_index, __pyx_k_vessel_index, sizeof(__pyx_k_vessel_index), 0, 0, 1, 1},
  {&__pyx_n_s_vessel_index_list, __pyx_k_vessel_index_list, sizeof(__pyx_k_vessel_index_list), 0, 0, 1, 1},
  {&__pyx_n_s_vessels, __pyx_k_vessels, sizeof(__pyx_k_vessels), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1},
  {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1},
  {&__pyx_n_s_x_hyper, __pyx_k_x_hyper, sizeof(__pyx_k_x_hyper), 0, 0, 1, 1},
  {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1},
  {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 372, __pyx_L1_error)
  __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 2069, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 14, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(2, 18, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error)
  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "pylsewave/cynum.pyx":375
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)             # <<<<<<<<<<<<<<
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_float_0_5); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "pylsewave/cynum.pyx":376
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)             # <<<<<<<<<<<<<<
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_float_neg_0_5); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "pylsewave/cynum.pyx":961
 *             self.vessels[i].r0 = self.mesh.vessels[i].r0
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)             # <<<<<<<<<<<<<<
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_float_0_5); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "pylsewave/cynum.pyx":962
 *             self.vessels[i].f_r0 = self.mesh.vessels[i].f_r0
 *             self.vessels[i].interpolate_R0p = self.mesh.vessels[i].interpolate_R0(0.5)
 *             self.vessels[i].interpolate_R0m = self.mesh.vessels[i].interpolate_R0(-0.5)             # <<<<<<<<<<<<<<
 *             self.vessels[i].f_r0_ph = self.mesh.vessels[i].f_r0_ph
 *             self.vessels[i].f_r0_mh = self.mesh.vessels[i].f_r0_mh
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_float_neg_0_5); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "pylsewave/cynum.pyx":1003
 *         cdef double[::1] C_v = np.zeros(siz, np.float)
 *         # print(np.asarray(dqdx))
 *         res = cpwgrad(np.asarray(u)[1, :], np.asarray(dqdx), self.vessels[vessel_index].dx)             # <<<<<<<<<<<<<<
 *         # print(np.asarray(dqdx))
 *         res = self.CV_f(u[0, :], vessel_index, C_v)
 */
  __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__7);
  __Pyx_GIVEREF(__pyx_slice__7);
  __pyx_tuple__8 = PyTuple_Pack(2, __pyx_int_1, __pyx_slice__7); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "pylsewave/cynum.pyx":1346
 *         _A = np.zeros(clms, dtype=np.float)
 *         _q = np.zeros(clms, dtype=np.float)
 *         u12_nh = np.zeros(2, dtype=np.float)             # <<<<<<<<<<<<<<
 *         F_ = np.zeros((rws, clms), dtype=np.float)
 *         S_ = np.zeros((rws, clms), dtype=np.float)
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "pylsewave/cynum.pyx":2088
 *     cdef CFL cfl_i(self, double[::1] uin, double dx, double dt, int index, int vessel_index):
 *         cdef double _A, _q, theta, c, u, ls, rs, comp_elem
 *         cdef double[::1] W = np.zeros(2, dtype=np.float)             # <<<<<<<<<<<<<<
 *         cdef int i
 *         _A = uin[0]
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "pylsewave/cynum.pyx":2112
 *     cdef CFL cfl_condition(self, double[:, ::1] uin, double dx, double dt, int vessel_index):
 *         cdef double _A, _q, theta, c, u, ls, rs, comp_elem
 *         cdef double[::1] W = np.zeros(2, dtype=np.float)             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef int size
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "pylsewave/cynum.pyx":2236
 *         x_n_conj = np.zeros(4, np.float)
 *         cdef int last_index, first_index, iter_count
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)             # <<<<<<<<<<<<<<
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)
 *         siz_U0 = self.U0_arr.shape[0]
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "pylsewave/cynum.pyx":2237
 *         cdef int last_index, first_index, iter_count
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)             # <<<<<<<<<<<<<<
 *         siz_U0 = self.U0_arr.shape[0]
 *         siz_UL = self.UL_arr.shape[0]
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "pylsewave/cynum.pyx":2708
 *         x_n_conj = np.zeros(4, np.float)
 *         cdef int last_index, first_index, iter_count
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)             # <<<<<<<<<<<<<<
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)
 *         siz_U0 = self.U0_arr.shape[0]
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "pylsewave/cynum.pyx":2709
 *         cdef int last_index, first_index, iter_count
 *         cdef int[::1] bif_list = np.zeros(3, dtype=np.int)
 *         cdef int[::1] conj_list = np.zeros(2, dtype=np.int)             # <<<<<<<<<<<<<<
 *         siz_U0 = self.U0_arr.shape[0]
 *         siz_UL = self.UL_arr.shape[0]
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             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__16 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             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__17 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":259
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' 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__18 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":799
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":803
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' 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__20 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "../../../Users/Giorgos/AppData/Local/Temp/pip-build-env-hdpd1wc7/Lib/site-packages/Cython/Includes/numpy/__init__.pxd":823
 *             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__21 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "FromPyStructUtility":19
 *         value = obj['r0']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'r0'")             # <<<<<<<<<<<<<<
 *     result.r0 = value
 *     try:
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "FromPyStructUtility":24
 *         value = obj['f_r0']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0'")             # <<<<<<<<<<<<<<
 *     result.f_r0 = value
 *     try:
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "FromPyStructUtility":29
 *         value = obj['interpolate_R0p']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0p'")             # <<<<<<<<<<<<<<
 *     result.interpolate_R0p = value
 *     try:
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "FromPyStructUtility":34
 *         value = obj['interpolate_R0m']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'interpolate_R0m'")             # <<<<<<<<<<<<<<
 *     result.interpolate_R0m = value
 *     try:
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "FromPyStructUtility":39
 *         value = obj['f_r0_ph']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0_ph'")             # <<<<<<<<<<<<<<
 *     result.f_r0_ph = value
 *     try:
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_5); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "FromPyStructUtility":44
 *         value = obj['f_r0_mh']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'f_r0_mh'")             # <<<<<<<<<<<<<<
 *     result.f_r0_mh = value
 *     try:
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_6); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "FromPyStructUtility":49
 *         value = obj['df_dr0']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0'")             # <<<<<<<<<<<<<<
 *     result.df_dr0 = value
 *     try:
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_7); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "FromPyStructUtility":54
 *         value = obj['df_dx']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx'")             # <<<<<<<<<<<<<<
 *     result.df_dx = value
 *     try:
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_8); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "FromPyStructUtility":59
 *         value = obj['df_dr0_ph']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0_ph'")             # <<<<<<<<<<<<<<
 *     result.df_dr0_ph = value
 *     try:
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_9); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "FromPyStructUtility":64
 *         value = obj['df_dx_ph']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx_ph'")             # <<<<<<<<<<<<<<
 *     result.df_dx_ph = value
 *     try:
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_10); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "FromPyStructUtility":69
 *         value = obj['df_dr0_mh']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dr0_mh'")             # <<<<<<<<<<<<<<
 *     result.df_dr0_mh = value
 *     try:
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_11); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "FromPyStructUtility":74
 *         value = obj['df_dx_mh']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'df_dx_mh'")             # <<<<<<<<<<<<<<
 *     result.df_dx_mh = value
 *     try:
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_12); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "FromPyStructUtility":79
 *         value = obj['L']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'L'")             # <<<<<<<<<<<<<<
 *     result.L = value
 *     try:
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_13); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "FromPyStructUtility":84
 *         value = obj['dx']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'dx'")             # <<<<<<<<<<<<<<
 *     result.dx = value
 *     try:
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_14); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "FromPyStructUtility":89
 *         value = obj['phi']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'phi'")             # <<<<<<<<<<<<<<
 *     result.phi = value
 *     try:
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_15); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "FromPyStructUtility":94
 *         value = obj['RLC']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'RLC'")             # <<<<<<<<<<<<<<
 *     result.RLC = value
 *     return result
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_16); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "FromPyStructUtility":19
 *         value = obj['x_hyper']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'x_hyper'")             # <<<<<<<<<<<<<<
 *     result.x_hyper = value
 *     try:
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_17); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "FromPyStructUtility":24
 *         value = obj['a']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a'")             # <<<<<<<<<<<<<<
 *     result.a = value
 *     try:
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_18); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(2, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "FromPyStructUtility":29
 *         value = obj['b']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'b'")             # <<<<<<<<<<<<<<
 *     result.b = value
 *     try:
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_19); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "FromPyStructUtility":34
 *         value = obj['c']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'c'")             # <<<<<<<<<<<<<<
 *     result.c = value
 *     try:
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_20); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "FromPyStructUtility":39
 *         value = obj['d']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'd'")             # <<<<<<<<<<<<<<
 *     result.d = value
 *     try:
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_21); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "FromPyStructUtility":44
 *         value = obj['a_ph']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a_ph'")             # <<<<<<<<<<<<<<
 *     result.a_ph = value
 *     try:
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_22); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "FromPyStructUtility":49
 *         value = obj['a_mh']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'a_mh'")             # <<<<<<<<<<<<<<
 *     result.a_mh = value
 *     return result
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_23); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "View.MemoryView":131
 * 
 *         if not self.ndim:
 *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if itemsize <= 0:
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "View.MemoryView":134
 * 
 *         if itemsize <= 0:
 *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(format, bytes):
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "View.MemoryView":137
 * 
 *         if not isinstance(format, bytes):
 *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "View.MemoryView":146
 * 
 *         if not self._shape:
 *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "View.MemoryView":174
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_is_object:
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "View.MemoryView":190
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
 *         info.buf = self.data
 *         info.len = self.len
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "View.MemoryView":484
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
 *         else:
 *             if len(self.view.format) == 1:
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(2, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "View.MemoryView":556
 *         if self.view.strides == NULL:
 * 
 *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "View.MemoryView":563
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 */
  __pyx_tuple__53 = PyTuple_New(1); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_tuple__53, 0, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "View.MemoryView":668
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
 *                 seen_ellipsis = True
 *             else:
 */
  __pyx_slice__54 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__54)) __PYX_ERR(2, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__54);
  __Pyx_GIVEREF(__pyx_slice__54);

  /* "View.MemoryView":671
 *                 seen_ellipsis = True
 *             else:
 *                 result.append(slice(None))             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
 */
  __pyx_slice__55 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__55)) __PYX_ERR(2, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__55);
  __Pyx_GIVEREF(__pyx_slice__55);

  /* "View.MemoryView":682
 *     nslices = ndim - len(result)
 *     if nslices:
 *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
 * 
 *     return have_slices or nslices, tuple(result)
 */
  __pyx_slice__56 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__56)) __PYX_ERR(2, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__56);
  __Pyx_GIVEREF(__pyx_slice__56);

  /* "View.MemoryView":689
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(2, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "pylsewave/cynum.pyx":270
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def cwrite2file(string filename, double[:, ::1] u):             # <<<<<<<<<<<<<<
 *     """
 *     Function to write results in a file.
 */
  __pyx_tuple__58 = PyTuple_Pack(4, __pyx_n_s_filename, __pyx_n_s_u, __pyx_n_s_rws, __pyx_n_s_clms); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_gitRepositories_github_pylsewa, __pyx_n_s_cwrite2file, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 270, __pyx_L1_error)

  /* "View.MemoryView":282
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(2, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "View.MemoryView":283
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(2, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "View.MemoryView":284
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "View.MemoryView":287
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(2, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "View.MemoryView":288
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(2, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  /* InitThreads.init */
  #ifdef WITH_THREAD
PyEval_InitThreads();
#endif

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_2_ = PyFloat_FromDouble(2.); if (unlikely(!__pyx_float_2_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_4_ = PyFloat_FromDouble(4.); if (unlikely(!__pyx_float_4_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_2_0 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_neg_0_5 = PyFloat_FromDouble(-0.5); if (unlikely(!__pyx_float_neg_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initcynum(void); /*proto*/
PyMODINIT_FUNC initcynum(void)
#else
PyMODINIT_FUNC PyInit_cynum(void); /*proto*/
PyMODINIT_FUNC PyInit_cynum(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  static PyThread_type_lock __pyx_t_2[8];
  __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_cynum(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __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("cynum", __pyx_methods, __pyx_k_This_is_a_Cython_file_with_clas, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __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_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_pylsewave__cynum) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "pylsewave.cynum")) {
      if (unlikely(PyDict_SetItemString(modules, "pylsewave.cynum", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global init code ---*/
  generic = Py_None; Py_INCREF(Py_None);
  strided = Py_None; Py_INCREF(Py_None);
  indirect = Py_None; Py_INCREF(Py_None);
  contiguous = Py_None; Py_INCREF(Py_None);
  indirect_contiguous = Py_None; Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cyVessel) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cyVessel.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "cyVessel", (PyObject *)&__pyx_type_9pylsewave_5cynum_cyVessel) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cyVessel = &__pyx_type_9pylsewave_5cynum_cyVessel;
  __pyx_type_9pylsewave_5cynum_cyVesselScaled.tp_base = __pyx_ptype_9pylsewave_5cynum_cyVessel;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cyVesselScaled) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cyVesselScaled.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "cyVesselScaled", (PyObject *)&__pyx_type_9pylsewave_5cynum_cyVesselScaled) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cyVesselScaled = &__pyx_type_9pylsewave_5cynum_cyVesselScaled;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cyVesselNetwork) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cyVesselNetwork.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "cyVesselNetwork", (PyObject *)&__pyx_type_9pylsewave_5cynum_cyVesselNetwork) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cyVesselNetwork = &__pyx_type_9pylsewave_5cynum_cyVesselNetwork;
  __pyx_type_9pylsewave_5cynum_cyVesselNetworkSc.tp_base = __pyx_ptype_9pylsewave_5cynum_cyVesselNetwork;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cyVesselNetworkSc) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cyVesselNetworkSc.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "cyVesselNetworkSc", (PyObject *)&__pyx_type_9pylsewave_5cynum_cyVesselNetworkSc) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cyVesselNetworkSc = &__pyx_type_9pylsewave_5cynum_cyVesselNetworkSc;
  __pyx_vtabptr_9pylsewave_5cynum_cPDEm = &__pyx_vtable_9pylsewave_5cynum_cPDEm;
  __pyx_vtable_9pylsewave_5cynum_cPDEm.set_boundary_layer_th = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, double, int, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_5cPDEm_set_boundary_layer_th;
  __pyx_vtable_9pylsewave_5cynum_cPDEm.set_vessels = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &, int, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_5cPDEm_set_vessels;
  __pyx_vtable_9pylsewave_5cynum_cPDEm.flux = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_5cPDEm_flux;
  __pyx_vtable_9pylsewave_5cynum_cPDEm.flux_i = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_5cPDEm_flux_i;
  __pyx_vtable_9pylsewave_5cynum_cPDEm.get_vessels = (std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *))__pyx_f_9pylsewave_5cynum_5cPDEm_get_vessels;
  __pyx_vtable_9pylsewave_5cynum_cPDEm.source = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_5cPDEm_source;
  __pyx_vtable_9pylsewave_5cynum_cPDEm.source_i = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_5cPDEm_source_i;
  __pyx_vtable_9pylsewave_5cynum_cPDEm.pressure_i = (double (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, double, int, int))__pyx_f_9pylsewave_5cynum_5cPDEm_pressure_i;
  __pyx_vtable_9pylsewave_5cynum_cPDEm.pressure = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_5cPDEm_pressure;
  __pyx_vtable_9pylsewave_5cynum_cPDEm.compute_c_i = (double (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, double, int, int, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_5cPDEm_compute_c_i;
  __pyx_vtable_9pylsewave_5cynum_cPDEm.compute_c = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_5cPDEm_compute_c;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cPDEm) < 0) __PYX_ERR(0, 322, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cPDEm.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_cPDEm.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_cPDEm) < 0) __PYX_ERR(0, 322, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "cPDEm", (PyObject *)&__pyx_type_9pylsewave_5cynum_cPDEm) < 0) __PYX_ERR(0, 322, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cPDEm = &__pyx_type_9pylsewave_5cynum_cPDEm;
  __pyx_vtabptr_9pylsewave_5cynum_cPDEsWat = &__pyx_vtable_9pylsewave_5cynum_cPDEsWat;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWat.__pyx_base = *__pyx_vtabptr_9pylsewave_5cynum_cPDEm;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWat.__pyx_base.flux = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_8cPDEsWat_flux;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWat.__pyx_base.flux_i = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_8cPDEsWat_flux_i;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWat.__pyx_base.source = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_8cPDEsWat_source;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWat.__pyx_base.source_i = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_8cPDEsWat_source_i;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWat.__pyx_base.pressure_i = (double (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, double, int, int))__pyx_f_9pylsewave_5cynum_8cPDEsWat_pressure_i;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWat.__pyx_base.pressure = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_8cPDEsWat_pressure;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWat.__pyx_base.compute_c_i = (double (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, double, int, int, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_8cPDEsWat_compute_c_i;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWat.__pyx_base.compute_c = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_8cPDEsWat_compute_c;
  __pyx_type_9pylsewave_5cynum_cPDEsWat.tp_base = __pyx_ptype_9pylsewave_5cynum_cPDEm;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cPDEsWat) < 0) __PYX_ERR(0, 676, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cPDEsWat.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_cPDEsWat.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_cPDEsWat) < 0) __PYX_ERR(0, 676, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "cPDEsWat", (PyObject *)&__pyx_type_9pylsewave_5cynum_cPDEsWat) < 0) __PYX_ERR(0, 676, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cPDEsWat = &__pyx_type_9pylsewave_5cynum_cPDEsWat;
  __pyx_vtabptr_9pylsewave_5cynum_cPDEsWatVisco = &__pyx_vtable_9pylsewave_5cynum_cPDEsWatVisco;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWatVisco.__pyx_base = *__pyx_vtabptr_9pylsewave_5cynum_cPDEsWat;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWatVisco.__pyx_base.__pyx_base.set_vessels = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &, int, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_set_vessels__pyx_wrap_1;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWatVisco.set_vessels = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  &, int, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_set_vessels;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWatVisco.pressure_visco = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *, __Pyx_memviewslice, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_pressure_visco;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWatVisco.CV_f = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEsWatVisco *, __Pyx_memviewslice, Py_ssize_t, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_CV_f;
  __pyx_vtable_9pylsewave_5cynum_cPDEsWatVisco.wall_th_x = (int (*)(__Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_13cPDEsWatVisco_wall_th_x;
  __pyx_type_9pylsewave_5cynum_cPDEsWatVisco.tp_base = __pyx_ptype_9pylsewave_5cynum_cPDEsWat;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cPDEsWatVisco) < 0) __PYX_ERR(0, 951, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cPDEsWatVisco.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_cPDEsWatVisco.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_cPDEsWatVisco) < 0) __PYX_ERR(0, 951, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "cPDEsWatVisco", (PyObject *)&__pyx_type_9pylsewave_5cynum_cPDEsWatVisco) < 0) __PYX_ERR(0, 951, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cPDEsWatVisco = &__pyx_type_9pylsewave_5cynum_cPDEsWatVisco;
  __pyx_vtabptr_9pylsewave_5cynum_PDEmCs = &__pyx_vtable_9pylsewave_5cynum_PDEmCs;
  __pyx_vtable_9pylsewave_5cynum_PDEmCs.__pyx_base = *__pyx_vtabptr_9pylsewave_5cynum_cPDEm;
  __pyx_vtable_9pylsewave_5cynum_PDEmCs.__pyx_base.flux = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_6PDEmCs_flux;
  __pyx_vtable_9pylsewave_5cynum_PDEmCs.__pyx_base.flux_i = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_6PDEmCs_flux_i;
  __pyx_vtable_9pylsewave_5cynum_PDEmCs.__pyx_base.get_vessels = (std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel>  (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *))__pyx_f_9pylsewave_5cynum_6PDEmCs_get_vessels;
  __pyx_vtable_9pylsewave_5cynum_PDEmCs.__pyx_base.source = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_6PDEmCs_source;
  __pyx_vtable_9pylsewave_5cynum_PDEmCs.__pyx_base.source_i = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, int, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_6PDEmCs_source_i;
  __pyx_vtable_9pylsewave_5cynum_PDEmCs.__pyx_base.compute_c_i = (double (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, double, int, int, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_6PDEmCs_compute_c_i;
  __pyx_vtable_9pylsewave_5cynum_PDEmCs.__pyx_base.compute_c = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cPDEm *, __Pyx_memviewslice, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_6PDEmCs_compute_c;
  __pyx_type_9pylsewave_5cynum_PDEmCs.tp_base = __pyx_ptype_9pylsewave_5cynum_cPDEm;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_PDEmCs) < 0) __PYX_ERR(0, 1071, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_PDEmCs.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_PDEmCs.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_PDEmCs) < 0) __PYX_ERR(0, 1071, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "PDEmCs", (PyObject *)&__pyx_type_9pylsewave_5cynum_PDEmCs) < 0) __PYX_ERR(0, 1071, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_PDEmCs = &__pyx_type_9pylsewave_5cynum_PDEmCs;
  __pyx_vtabptr_9pylsewave_5cynum_cBCs = &__pyx_vtable_9pylsewave_5cynum_cBCs;
  __pyx_vtable_9pylsewave_5cynum_cBCs.set_vessels = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, std::vector<struct __pyx_t_9pylsewave_5cynum_cvessel> ))__pyx_f_9pylsewave_5cynum_4cBCs_set_vessels;
  __pyx_vtable_9pylsewave_5cynum_cBCs.get_pdes = (struct __pyx_obj_9pylsewave_5cynum_cPDEm *(*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *))__pyx_f_9pylsewave_5cynum_4cBCs_get_pdes;
  __pyx_vtable_9pylsewave_5cynum_cBCs.set_pdes = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, struct __pyx_obj_9pylsewave_5cynum_cPDEm *))__pyx_f_9pylsewave_5cynum_4cBCs_set_pdes;
  __pyx_vtable_9pylsewave_5cynum_cBCs.U_0 = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, double, double, double, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_4cBCs_U_0;
  __pyx_vtable_9pylsewave_5cynum_cBCs.U_L = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, double, double, double, int, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_4cBCs_U_L;
  __pyx_vtable_9pylsewave_5cynum_cBCs.I = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, double, int, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_4cBCs_I;
  __pyx_vtable_9pylsewave_5cynum_cBCs.bifurcation_R = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, double, __Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_4cBCs_bifurcation_R;
  __pyx_vtable_9pylsewave_5cynum_cBCs.bifurcation_Jr = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_4cBCs_bifurcation_Jr;
  __pyx_vtable_9pylsewave_5cynum_cBCs.conjuction_R = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, double, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_4cBCs_conjuction_R;
  __pyx_vtable_9pylsewave_5cynum_cBCs.conjuction_Jr = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_4cBCs_conjuction_Jr;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cBCs) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cBCs.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_cBCs.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_cBCs) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "cBCs", (PyObject *)&__pyx_type_9pylsewave_5cynum_cBCs) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cBCs = &__pyx_type_9pylsewave_5cynum_cBCs;
  __pyx_vtabptr_9pylsewave_5cynum_cBCsWat = &__pyx_vtable_9pylsewave_5cynum_cBCsWat;
  __pyx_vtable_9pylsewave_5cynum_cBCsWat.__pyx_base = *__pyx_vtabptr_9pylsewave_5cynum_cBCs;
  __pyx_vtable_9pylsewave_5cynum_cBCsWat.__pyx_base.U_0 = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, double, double, double, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_7cBCsWat_U_0;
  __pyx_vtable_9pylsewave_5cynum_cBCsWat.__pyx_base.bifurcation_R = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, double, __Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_7cBCsWat_bifurcation_R;
  __pyx_vtable_9pylsewave_5cynum_cBCsWat.__pyx_base.bifurcation_Jr = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_7cBCsWat_bifurcation_Jr;
  __pyx_vtable_9pylsewave_5cynum_cBCsWat.__pyx_base.conjuction_R = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, double, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_7cBCsWat_conjuction_R;
  __pyx_vtable_9pylsewave_5cynum_cBCsWat.__pyx_base.conjuction_Jr = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_7cBCsWat_conjuction_Jr;
  __pyx_type_9pylsewave_5cynum_cBCsWat.tp_base = __pyx_ptype_9pylsewave_5cynum_cBCs;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cBCsWat) < 0) __PYX_ERR(0, 1587, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cBCsWat.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_cBCsWat.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_cBCsWat) < 0) __PYX_ERR(0, 1587, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "cBCsWat", (PyObject *)&__pyx_type_9pylsewave_5cynum_cBCsWat) < 0) __PYX_ERR(0, 1587, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cBCsWat = &__pyx_type_9pylsewave_5cynum_cBCsWat;
  __pyx_vtabptr_9pylsewave_5cynum_BCsSc = &__pyx_vtable_9pylsewave_5cynum_BCsSc;
  __pyx_vtable_9pylsewave_5cynum_BCsSc.__pyx_base = *__pyx_vtabptr_9pylsewave_5cynum_cBCs;
  __pyx_vtable_9pylsewave_5cynum_BCsSc.__pyx_base.bifurcation_R = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, double, __Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_5BCsSc_bifurcation_R;
  __pyx_vtable_9pylsewave_5cynum_BCsSc.__pyx_base.bifurcation_Jr = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_5BCsSc_bifurcation_Jr;
  __pyx_vtable_9pylsewave_5cynum_BCsSc.__pyx_base.conjuction_R = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, double, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_5BCsSc_conjuction_R;
  __pyx_vtable_9pylsewave_5cynum_BCsSc.__pyx_base.conjuction_Jr = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_5BCsSc_conjuction_Jr;
  __pyx_type_9pylsewave_5cynum_BCsSc.tp_base = __pyx_ptype_9pylsewave_5cynum_cBCs;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_BCsSc) < 0) __PYX_ERR(0, 1766, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_BCsSc.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_BCsSc.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_BCsSc) < 0) __PYX_ERR(0, 1766, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "BCsSc", (PyObject *)&__pyx_type_9pylsewave_5cynum_BCsSc) < 0) __PYX_ERR(0, 1766, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_BCsSc = &__pyx_type_9pylsewave_5cynum_BCsSc;
  __pyx_vtabptr_9pylsewave_5cynum_BCsD = &__pyx_vtable_9pylsewave_5cynum_BCsD;
  __pyx_vtable_9pylsewave_5cynum_BCsD.__pyx_base = *__pyx_vtabptr_9pylsewave_5cynum_cBCs;
  __pyx_vtable_9pylsewave_5cynum_BCsD.__pyx_base.U_0 = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, double, double, double, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_4BCsD_U_0;
  __pyx_type_9pylsewave_5cynum_BCsD.tp_base = __pyx_ptype_9pylsewave_5cynum_cBCs;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_BCsD) < 0) __PYX_ERR(0, 1924, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_BCsD.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_BCsD.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_BCsD) < 0) __PYX_ERR(0, 1924, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "BCsD", (PyObject *)&__pyx_type_9pylsewave_5cynum_BCsD) < 0) __PYX_ERR(0, 1924, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_BCsD = &__pyx_type_9pylsewave_5cynum_BCsD;
  __pyx_vtabptr_9pylsewave_5cynum_BCsADAN56 = &__pyx_vtable_9pylsewave_5cynum_BCsADAN56;
  __pyx_vtable_9pylsewave_5cynum_BCsADAN56.__pyx_base = *__pyx_vtabptr_9pylsewave_5cynum_cBCsWat;
  __pyx_vtable_9pylsewave_5cynum_BCsADAN56.__pyx_base.__pyx_base.U_0 = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, double, double, double, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_9BCsADAN56_U_0;
  __pyx_vtable_9pylsewave_5cynum_BCsADAN56.__pyx_base.__pyx_base.U_L = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, double, double, double, int, __Pyx_memviewslice))__pyx_f_9pylsewave_5cynum_9BCsADAN56_U_L;
  __pyx_type_9pylsewave_5cynum_BCsADAN56.tp_base = __pyx_ptype_9pylsewave_5cynum_cBCsWat;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_BCsADAN56) < 0) __PYX_ERR(0, 1951, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_BCsADAN56.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_BCsADAN56.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_BCsADAN56) < 0) __PYX_ERR(0, 1951, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "BCsADAN56", (PyObject *)&__pyx_type_9pylsewave_5cynum_BCsADAN56) < 0) __PYX_ERR(0, 1951, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_BCsADAN56 = &__pyx_type_9pylsewave_5cynum_BCsADAN56;
  __pyx_vtabptr_9pylsewave_5cynum_cBCsHandModelNonReflBcs = &__pyx_vtable_9pylsewave_5cynum_cBCsHandModelNonReflBcs;
  __pyx_vtable_9pylsewave_5cynum_cBCsHandModelNonReflBcs.__pyx_base = *__pyx_vtabptr_9pylsewave_5cynum_cBCsWat;
  __pyx_vtable_9pylsewave_5cynum_cBCsHandModelNonReflBcs.__pyx_base.__pyx_base.U_0 = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cBCs *, __Pyx_memviewslice, double, double, double, int, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_23cBCsHandModelNonReflBcs_U_0;
  __pyx_type_9pylsewave_5cynum_cBCsHandModelNonReflBcs.tp_base = __pyx_ptype_9pylsewave_5cynum_cBCsWat;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cBCsHandModelNonReflBcs) < 0) __PYX_ERR(0, 2011, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cBCsHandModelNonReflBcs.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_cBCsHandModelNonReflBcs.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_cBCsHandModelNonReflBcs) < 0) __PYX_ERR(0, 2011, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "cBCsHandModelNonReflBcs", (PyObject *)&__pyx_type_9pylsewave_5cynum_cBCsHandModelNonReflBcs) < 0) __PYX_ERR(0, 2011, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cBCsHandModelNonReflBcs = &__pyx_type_9pylsewave_5cynum_cBCsHandModelNonReflBcs;
  __pyx_vtabptr_9pylsewave_5cynum_cFDMSolver = &__pyx_vtable_9pylsewave_5cynum_cFDMSolver;
  __pyx_vtable_9pylsewave_5cynum_cFDMSolver.set_T = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, double, double, int, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_10cFDMSolver_set_T;
  __pyx_vtable_9pylsewave_5cynum_cFDMSolver.set_BC = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_10cFDMSolver_set_BC;
  __pyx_vtable_9pylsewave_5cynum_cFDMSolver.cfl_i = (enum __pyx_t_9pylsewave_5cynum_CFL (*)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, __Pyx_memviewslice, double, double, int, int))__pyx_f_9pylsewave_5cynum_10cFDMSolver_cfl_i;
  __pyx_vtable_9pylsewave_5cynum_cFDMSolver.cfl_condition = (enum __pyx_t_9pylsewave_5cynum_CFL (*)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, __Pyx_memviewslice, double, double, int))__pyx_f_9pylsewave_5cynum_10cFDMSolver_cfl_condition;
  __pyx_vtable_9pylsewave_5cynum_cFDMSolver.initialise_solution_vector = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, std::vector<struct __pyx_t_9pylsewave_5cynum_U>  &, int))__pyx_f_9pylsewave_5cynum_10cFDMSolver_initialise_solution_vector;
  __pyx_vtable_9pylsewave_5cynum_cFDMSolver.solve = (enum __pyx_t_9pylsewave_5cynum_SOLVER (*)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pylsewave_5cynum_10cFDMSolver_solve *__pyx_optional_args))__pyx_f_9pylsewave_5cynum_10cFDMSolver_solve;
  __pyx_vtable_9pylsewave_5cynum_cFDMSolver.advance = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, struct __pyx_t_9pylsewave_5cynum_U, double, double, int))__pyx_f_9pylsewave_5cynum_10cFDMSolver_advance;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cFDMSolver) < 0) __PYX_ERR(0, 2039, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cFDMSolver.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_cFDMSolver.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_cFDMSolver) < 0) __PYX_ERR(0, 2039, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "cFDMSolver", (PyObject *)&__pyx_type_9pylsewave_5cynum_cFDMSolver) < 0) __PYX_ERR(0, 2039, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cFDMSolver = &__pyx_type_9pylsewave_5cynum_cFDMSolver;
  __pyx_vtabptr_9pylsewave_5cynum_cLaxWendroffSolver = &__pyx_vtable_9pylsewave_5cynum_cLaxWendroffSolver;
  __pyx_vtable_9pylsewave_5cynum_cLaxWendroffSolver.__pyx_base = *__pyx_vtabptr_9pylsewave_5cynum_cFDMSolver;
  __pyx_vtable_9pylsewave_5cynum_cLaxWendroffSolver.__pyx_base.advance = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, struct __pyx_t_9pylsewave_5cynum_U, double, double, int))__pyx_f_9pylsewave_5cynum_18cLaxWendroffSolver_advance;
  __pyx_type_9pylsewave_5cynum_cLaxWendroffSolver.tp_base = __pyx_ptype_9pylsewave_5cynum_cFDMSolver;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cLaxWendroffSolver) < 0) __PYX_ERR(0, 2426, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cLaxWendroffSolver.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_cLaxWendroffSolver.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_cLaxWendroffSolver) < 0) __PYX_ERR(0, 2426, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "cLaxWendroffSolver", (PyObject *)&__pyx_type_9pylsewave_5cynum_cLaxWendroffSolver) < 0) __PYX_ERR(0, 2426, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cLaxWendroffSolver = &__pyx_type_9pylsewave_5cynum_cLaxWendroffSolver;
  __pyx_vtabptr_9pylsewave_5cynum_cMacCormackSolver = &__pyx_vtable_9pylsewave_5cynum_cMacCormackSolver;
  __pyx_vtable_9pylsewave_5cynum_cMacCormackSolver.__pyx_base = *__pyx_vtabptr_9pylsewave_5cynum_cFDMSolver;
  __pyx_vtable_9pylsewave_5cynum_cMacCormackSolver.__pyx_base.advance = (void (*)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, struct __pyx_t_9pylsewave_5cynum_U, double, double, int))__pyx_f_9pylsewave_5cynum_17cMacCormackSolver_advance;
  __pyx_type_9pylsewave_5cynum_cMacCormackSolver.tp_base = __pyx_ptype_9pylsewave_5cynum_cFDMSolver;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cMacCormackSolver) < 0) __PYX_ERR(0, 2509, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cMacCormackSolver.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_cMacCormackSolver.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_cMacCormackSolver) < 0) __PYX_ERR(0, 2509, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "cMacCormackSolver", (PyObject *)&__pyx_type_9pylsewave_5cynum_cMacCormackSolver) < 0) __PYX_ERR(0, 2509, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cMacCormackSolver = &__pyx_type_9pylsewave_5cynum_cMacCormackSolver;
  __pyx_vtabptr_9pylsewave_5cynum_cMacCormackGodunovSplitSolver = &__pyx_vtable_9pylsewave_5cynum_cMacCormackGodunovSplitSolver;
  __pyx_vtable_9pylsewave_5cynum_cMacCormackGodunovSplitSolver.__pyx_base = *__pyx_vtabptr_9pylsewave_5cynum_cMacCormackSolver;
  __pyx_vtable_9pylsewave_5cynum_cMacCormackGodunovSplitSolver.__pyx_base.__pyx_base.solve = (enum __pyx_t_9pylsewave_5cynum_SOLVER (*)(struct __pyx_obj_9pylsewave_5cynum_cFDMSolver *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pylsewave_5cynum_10cFDMSolver_solve *__pyx_optional_args))__pyx_f_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver_solve;
  __pyx_vtable_9pylsewave_5cynum_cMacCormackGodunovSplitSolver._advance_Godunov_splitting = (int (*)(struct __pyx_obj_9pylsewave_5cynum_cMacCormackGodunovSplitSolver *, struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj, __Pyx_memviewslice, int, double, double, int, double, int __pyx_skip_dispatch))__pyx_f_9pylsewave_5cynum_29cMacCormackGodunovSplitSolver__advance_Godunov_splitting;
  __pyx_type_9pylsewave_5cynum_cMacCormackGodunovSplitSolver.tp_base = __pyx_ptype_9pylsewave_5cynum_cMacCormackSolver;
  if (PyType_Ready(&__pyx_type_9pylsewave_5cynum_cMacCormackGodunovSplitSolver) < 0) __PYX_ERR(0, 2577, __pyx_L1_error)
  __pyx_type_9pylsewave_5cynum_cMacCormackGodunovSplitSolver.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_9pylsewave_5cynum_cMacCormackGodunovSplitSolver.tp_dict, __pyx_vtabptr_9pylsewave_5cynum_cMacCormackGodunovSplitSolver) < 0) __PYX_ERR(0, 2577, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "cMacCormackGodunovSplitSolver", (PyObject *)&__pyx_type_9pylsewave_5cynum_cMacCormackGodunovSplitSolver) < 0) __PYX_ERR(0, 2577, __pyx_L1_error)
  __pyx_ptype_9pylsewave_5cynum_cMacCormackGodunovSplitSolver = &__pyx_type_9pylsewave_5cynum_cMacCormackGodunovSplitSolver;
  __pyx_vtabptr_array = &__pyx_vtable_array;
  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error)
  __pyx_type___pyx_array.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error)
  __pyx_array_type = &__pyx_type___pyx_array;
  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error)
  __pyx_type___pyx_MemviewEnum.tp_print = 0;
  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error)
  __pyx_type___pyx_memoryview.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __pyx_L1_error)
  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error)
  __pyx_type___pyx_memoryviewslice.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __pyx_L1_error)
  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error)
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "pylsewave/cynum.pyx":9
 * from cython.parallel import parallel
 * # import both numpy and the Cython declarations for numpy
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * cimport c_cynum
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":21
 * from libc.stdio cimport printf
 * from cython.operator cimport dereference as deref
 * import os             # <<<<<<<<<<<<<<
 * 
 * __author__ = "Georgios E. Ragkousis"
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":23
 * import os
 * 
 * __author__ = "Georgios E. Ragkousis"             # <<<<<<<<<<<<<<
 * 
 * ctypedef np.float_t DTYPE_t
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Georgios_E_Ragkousis) < 0) __PYX_ERR(0, 23, __pyx_L1_error)

  /* "pylsewave/cynum.pyx":27
 * ctypedef np.float_t DTYPE_t
 * 
 * cdef int STATUS_OK = 0             # <<<<<<<<<<<<<<
 * cdef int STATUS_ERROR = -1
 * 
 */
  __pyx_v_9pylsewave_5cynum_STATUS_OK = 0;

  /* "pylsewave/cynum.pyx":28
 * 
 * cdef int STATUS_OK = 0
 * cdef int STATUS_ERROR = -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_9pylsewave_5cynum_STATUS_ERROR = -1;

  /* "pylsewave/cynum.pyx":35
 * 
 *     def __cinit__(self, string name, DTYPE_t L, DTYPE_t R_prox, DTYPE_t R_dist,
 *                   DTYPE_t Wall_th, dict Windk = dict(), int Id = 0, rc=0):             # <<<<<<<<<<<<<<
 *         if type(self) is cyVessel:
 *             self.thisptr = new Vessel(name, L, R_prox, R_dist, Wall_th, Windk, Id)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_ = ((PyObject*)__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":141
 *     cdef VesselScaled *thisptrDerived
 *     def __cinit__(self, string name, DTYPE_t L, DTYPE_t R_prox, DTYPE_t R_dist,
 *                   DTYPE_t Wall_th, dict Windk=dict(), int Id=0, DTYPE_t rc=1.0):             # <<<<<<<<<<<<<<
 *         if type(self) is cyVesselScaled:
 *             self.thisptrDerived = self.thisptr = new VesselScaled(name, L, R_prox, R_dist, Wall_th, Windk, Id, rc)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__2 = ((PyObject*)__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":270
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def cwrite2file(string filename, double[:, ::1] u):             # <<<<<<<<<<<<<<
 *     """
 *     Function to write results in a file.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pylsewave_5cynum_7cwrite2file, NULL, __pyx_n_s_pylsewave_cynum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cwrite2file, __pyx_t_1) < 0) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pylsewave/cynum.pyx":283
 *     return write2file(filename, &u[0, 0], rws, clms)
 * 
 * PRINT_STATUS = False             # <<<<<<<<<<<<<<
 * WRITE_STATUS = True
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PRINT_STATUS, Py_False) < 0) __PYX_ERR(0, 283, __pyx_L1_error)

  /* "pylsewave/cynum.pyx":284
 * 
 * PRINT_STATUS = False
 * WRITE_STATUS = True             # <<<<<<<<<<<<<<
 * 
 * cdef enum CFL:
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WRITE_STATUS, Py_True) < 0) __PYX_ERR(0, 284, __pyx_L1_error)

  /* "pylsewave/cynum.pyx":1
 * """             # <<<<<<<<<<<<<<
 * This is a Cython file with classes for pylsewave toolkit. Cython translates everything to C++.
 * This module contains solvers that support OPENMP (via Cython OpenMP) for parallel CPU calcs.
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":207
 *         info.obj = self
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(array self):
 */
  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_array_type);

  /* "View.MemoryView":282
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(generic);
  __Pyx_DECREF_SET(generic, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":283
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(strided);
  __Pyx_DECREF_SET(strided, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":284
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(indirect);
  __Pyx_DECREF_SET(indirect, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":287
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(contiguous);
  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":288
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(indirect_contiguous);
  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":312
 * 
 * DEF THREAD_LOCKS_PREALLOCATED = 8
 * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
 * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
 *     PyThread_allocate_lock(),
 */
  __pyx_memoryview_thread_locks_used = 0;

  /* "View.MemoryView":313
 * DEF THREAD_LOCKS_PREALLOCATED = 8
 * cdef int __pyx_memoryview_thread_locks_used = 0
 * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
 *     PyThread_allocate_lock(),
 *     PyThread_allocate_lock(),
 */
  __pyx_t_2[0] = PyThread_allocate_lock();
  __pyx_t_2[1] = PyThread_allocate_lock();
  __pyx_t_2[2] = PyThread_allocate_lock();
  __pyx_t_2[3] = PyThread_allocate_lock();
  __pyx_t_2[4] = PyThread_allocate_lock();
  __pyx_t_2[5] = PyThread_allocate_lock();
  __pyx_t_2[6] = PyThread_allocate_lock();
  __pyx_t_2[7] = PyThread_allocate_lock();
  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));

  /* "View.MemoryView":535
 *         info.obj = self
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_memoryview_type);

  /* "View.MemoryView":981
 *         return self.from_object
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_memoryviewslice_type);

  /* "View.MemoryView":1391
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                               Py_ssize_t *strides, int ndim,
 *                               size_t itemsize, void *item) nogil:
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init pylsewave.cynum", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pylsewave.cynum");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#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

/* GetBuiltinName */
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;
}

/* RaiseArgTupleInvalid */
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);
}

/* RaiseDoubleKeywords */
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
}

/* ParseKeywords */
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;
}

/* ArgTypeTest */
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;
}

/* GetModuleGlobalName */
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;
}

/* PyObjectCall */
  #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

/* PyObjectCallMethO */
  #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

/* PyObjectCallOneArg */
  #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* ExtTypeTest */
    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;
}

/* BufferFormatCheck */
    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);
}

/* PyErrFetchRestore */
      #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    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);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* WriteUnraisableException */
      static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* MemviewSliceInit */
      static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
                        int ndim,
                        __Pyx_memviewslice *memviewslice,
                        int memview_is_new_reference)
{
    __Pyx_RefNannyDeclarations
    int i, retval=-1;
    Py_buffer *buf = &memview->view;
    __Pyx_RefNannySetupContext("init_memviewslice", 0);
    if (!buf) {
        PyErr_SetString(PyExc_ValueError,
            "buf is NULL.");
        goto fail;
    } else if (memviewslice->memview || memviewslice->data) {
        PyErr_SetString(PyExc_ValueError,
            "memviewslice is already initialized!");
        goto fail;
    }
    if (buf->strides) {
        for (i = 0; i < ndim; i++) {
            memviewslice->strides[i] = buf->strides[i];
        }
    } else {
        Py_ssize_t stride = buf->itemsize;
        for (i = ndim - 1; i >= 0; i--) {
            memviewslice->strides[i] = stride;
            stride *= buf->shape[i];
        }
    }
    for (i = 0; i < ndim; i++) {
        memviewslice->shape[i]   = buf->shape[i];
        if (buf->suboffsets) {
            memviewslice->suboffsets[i] = buf->suboffsets[i];
        } else {
            memviewslice->suboffsets[i] = -1;
        }
    }
    memviewslice->memview = memview;
    memviewslice->data = (char *)buf->buf;
    if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
        Py_INCREF(memview);
    }
    retval = 0;
    goto no_fail;
fail:
    memviewslice->memview = 0;
    memviewslice->data = 0;
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}
static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) {
    va_list vargs;
    char msg[200];
#ifdef HAVE_STDARG_PROTOTYPES
    va_start(vargs, fmt);
#else
    va_start(vargs);
#endif
    vsnprintf(msg, 200, fmt, vargs);
    Py_FatalError(msg);
    va_end(vargs);
}
static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)++;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)--;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
{
    int first_time;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (!memview || (PyObject *) memview == Py_None)
        return;
    if (__pyx_get_slice_count(memview) < 0)
        __pyx_fatalerror("Acquisition count is %d (line %d)",
                         __pyx_get_slice_count(memview), lineno);
    first_time = __pyx_add_acquisition_count(memview) == 0;
    if (first_time) {
        if (have_gil) {
            Py_INCREF((PyObject *) memview);
        } else {
            PyGILState_STATE _gilstate = PyGILState_Ensure();
            Py_INCREF((PyObject *) memview);
            PyGILState_Release(_gilstate);
        }
    }
}
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
                                             int have_gil, int lineno) {
    int last_time;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (!memview ) {
        return;
    } else if ((PyObject *) memview == Py_None) {
        memslice->memview = NULL;
        return;
    }
    if (__pyx_get_slice_count(memview) <= 0)
        __pyx_fatalerror("Acquisition count is %d (line %d)",
                         __pyx_get_slice_count(memview), lineno);
    last_time = __pyx_sub_acquisition_count(memview) == 1;
    memslice->data = NULL;
    if (last_time) {
        if (have_gil) {
            Py_CLEAR(memslice->memview);
        } else {
            PyGILState_STATE _gilstate = PyGILState_Ensure();
            Py_CLEAR(memslice->memview);
            PyGILState_Release(_gilstate);
        }
    } else {
        memslice->memview = NULL;
    }
}

/* GetItemInt */
      static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyObjectCallNoArg */
      #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

/* None */
        static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* BufferIndexError */
        static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}

/* RaiseTooManyValuesToUnpack */
        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);
}

/* RaiseNeedMoreValuesToUnpack */
        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");
}

/* IterFinish */
        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
}

/* UnpackItemEndCheck */
        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;
}

/* PyIntBinop */
        #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyIntBinop */
        #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* PyFloatBinop */
        #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
    const double b = floatval;
    double a, result;
    if (likely(PyFloat_CheckExact(op1))) {
        a = PyFloat_AS_DOUBLE(op1);
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        switch (size) {
            case  0: a = 0.0; break;
            case -1: a = -(double) digits[0]; break;
            case  1: a = (double) digits[0]; break;
            case -2:
            case 2:
                if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                    a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
                        if (size == -2)
                            a = -a;
                        break;
                    }
                }
            case -3:
            case 3:
                if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
                        if (size == -3)
                            a = -a;
                        break;
                    }
                }
            case -4:
            case 4:
                if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
                        if (size == -4)
                            a = -a;
                        break;
                    }
                }
            default:
        #else
        {
        #endif
            a = PyLong_AsDouble(op1);
            if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
        }
    } else {
        return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
    }
        PyFPE_START_PROTECT("divide", return NULL)
        result = a / b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* Import */
          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;
}

/* PyIntBinop */
          #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) {
            Py_RETURN_TRUE;
        } else {
            Py_RETURN_FALSE;
        }
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
                default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
                #else
                default: Py_RETURN_FALSE;
                #endif
            }
        }
            if (a == b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            if ((double)a == (double)b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    return PyObject_RichCompare(op1, op2, Py_EQ);
}
#endif

/* PyIntBinop */
          #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* RaiseException */
          #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    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_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* RaiseNoneIterError */
            static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* SaveResetException */
            #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
            #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    return PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
            #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
#endif
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* PyObjectCallMethod0 */
              static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* UnpackTupleError */
              static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
              static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                             int is_tuple, int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
        iternextfunc iternext;
        iter = PyObject_GetIter(tuple);
        if (unlikely(!iter)) goto bad;
        if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
        iternext = Py_TYPE(iter)->tp_iternext;
        value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
        value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
        if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
        Py_DECREF(iter);
    } else {
        if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
            __Pyx_UnpackTupleError(tuple, 2);
            goto bad;
        }
#if CYTHON_COMPILING_IN_PYPY
        value1 = PySequence_ITEM(tuple, 0);
        if (unlikely(!value1)) goto bad;
        value2 = PySequence_ITEM(tuple, 1);
        if (unlikely(!value2)) goto bad;
#else
        value1 = PyTuple_GET_ITEM(tuple, 0);
        value2 = PyTuple_GET_ITEM(tuple, 1);
        Py_INCREF(value1);
        Py_INCREF(value2);
#endif
        if (decref_tuple) { Py_DECREF(tuple); }
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
              static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
#if !CYTHON_COMPILING_IN_PYPY
    if (is_dict) {
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#endif
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* BytesEquals */
              static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
              static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* None */
              static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* GetAttr */
              static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* decode_c_string */
              static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        size_t slen = strlen(cstring);
        if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
            PyErr_SetString(PyExc_OverflowError,
                            "c-string too long to convert to Python");
            return NULL;
        }
        length = (Py_ssize_t) slen;
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* SwapException */
              #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* None */
              static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* SetVTable */
              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;
}

/* CodeObjectCache */
              static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
              #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);
        if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
        if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_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


              /* MemviewSliceIsContig */
              static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
                             char order, int ndim)
{
    int i, index, step, start;
    Py_ssize_t itemsize = mvs.memview->view.itemsize;
    if (order == 'F') {
        step = 1;
        start = 0;
    } else {
        step = -1;
        start = ndim - 1;
    }
    for (i = 0; i < ndim; i++) {
        index = start + step * i;
        if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
            return 0;
        itemsize *= mvs.shape[index];
    }
    return 1;
}

/* OverlappingSlices */
              static void
__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
                               void **out_start, void **out_end,
                               int ndim, size_t itemsize)
{
    char *start, *end;
    int i;
    start = end = slice->data;
    for (i = 0; i < ndim; i++) {
        Py_ssize_t stride = slice->strides[i];
        Py_ssize_t extent = slice->shape[i];
        if (extent == 0) {
            *out_start = *out_end = start;
            return;
        } else {
            if (stride > 0)
                end += stride * (extent - 1);
            else
                start += stride * (extent - 1);
        }
    }
    *out_start = start;
    *out_end = end + itemsize;
}
static int
__pyx_slices_overlap(__Pyx_memviewslice *slice1,
                     __Pyx_memviewslice *slice2,
                     int ndim, size_t itemsize)
{
    void *start1, *end1, *start2, *end2;
    __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
    __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
    return (start1 < end2) && (start2 < end1);
}

/* Capsule */
              static CYTHON_INLINE PyObject *
__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
{
    PyObject *cobj;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(p, sig, NULL);
#else
    cobj = PyCObject_FromVoidPtr(p, NULL);
#endif
    return cobj;
}

/* CIntFromPyVerify */
              #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* TypeInfoCompare */
              static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
    int i;
    if (!a || !b)
        return 0;
    if (a == b)
        return 1;
    if (a->size != b->size || a->typegroup != b->typegroup ||
            a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
        if (a->typegroup == 'H' || b->typegroup == 'H') {
            return a->size == b->size;
        } else {
            return 0;
        }
    }
    if (a->ndim) {
        for (i = 0; i < a->ndim; i++)
            if (a->arraysize[i] != b->arraysize[i])
                return 0;
    }
    if (a->typegroup == 'S') {
        if (a->flags != b->flags)
            return 0;
        if (a->fields || b->fields) {
            if (!(a->fields && b->fields))
                return 0;
            for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
                __Pyx_StructField *field_a = a->fields + i;
                __Pyx_StructField *field_b = b->fields + i;
                if (field_a->offset != field_b->offset ||
                    !__pyx_typeinfo_cmp(field_a->type, field_b->type))
                    return 0;
            }
            return !a->fields[i].type && !b->fields[i].type;
        }
    }
    return 1;
}

/* MemviewSliceValidateAndInit */
              static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
    if (buf->shape[dim] <= 1)
        return 1;
    if (buf->strides) {
        if (spec & __Pyx_MEMVIEW_CONTIG) {
            if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
                if (buf->strides[dim] != sizeof(void *)) {
                    PyErr_Format(PyExc_ValueError,
                                 "Buffer is not indirectly contiguous "
                                 "in dimension %d.", dim);
                    goto fail;
                }
            } else if (buf->strides[dim] != buf->itemsize) {
                PyErr_SetString(PyExc_ValueError,
                                "Buffer and memoryview are not contiguous "
                                "in the same dimension.");
                goto fail;
            }
        }
        if (spec & __Pyx_MEMVIEW_FOLLOW) {
            Py_ssize_t stride = buf->strides[dim];
            if (stride < 0)
                stride = -stride;
            if (stride < buf->itemsize) {
                PyErr_SetString(PyExc_ValueError,
                                "Buffer and memoryview are not contiguous "
                                "in the same dimension.");
                goto fail;
            }
        }
    } else {
        if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
            PyErr_Format(PyExc_ValueError,
                         "C-contiguous buffer is not contiguous in "
                         "dimension %d", dim);
            goto fail;
        } else if (spec & (__Pyx_MEMVIEW_PTR)) {
            PyErr_Format(PyExc_ValueError,
                         "C-contiguous buffer is not indirect in "
                         "dimension %d", dim);
            goto fail;
        } else if (buf->suboffsets) {
            PyErr_SetString(PyExc_ValueError,
                            "Buffer exposes suboffsets but no strides");
            goto fail;
        }
    }
    return 1;
fail:
    return 0;
}
static int
__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
{
    if (spec & __Pyx_MEMVIEW_DIRECT) {
        if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
            PyErr_Format(PyExc_ValueError,
                         "Buffer not compatible with direct access "
                         "in dimension %d.", dim);
            goto fail;
        }
    }
    if (spec & __Pyx_MEMVIEW_PTR) {
        if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
            PyErr_Format(PyExc_ValueError,
                         "Buffer is not indirectly accessible "
                         "in dimension %d.", dim);
            goto fail;
        }
    }
    return 1;
fail:
    return 0;
}
static int
__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
{
    int i;
    if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
        Py_ssize_t stride = 1;
        for (i = 0; i < ndim; i++) {
            if (stride * buf->itemsize != buf->strides[i] &&
                    buf->shape[i] > 1)
            {
                PyErr_SetString(PyExc_ValueError,
                    "Buffer not fortran contiguous.");
                goto fail;
            }
            stride = stride * buf->shape[i];
        }
    } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
        Py_ssize_t stride = 1;
        for (i = ndim - 1; i >- 1; i--) {
            if (stride * buf->itemsize != buf->strides[i] &&
                    buf->shape[i] > 1) {
                PyErr_SetString(PyExc_ValueError,
                    "Buffer not C contiguous.");
                goto fail;
            }
            stride = stride * buf->shape[i];
        }
    }
    return 1;
fail:
    return 0;
}
static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                __Pyx_TypeInfo *dtype,
                __Pyx_BufFmt_StackElem stack[],
                __Pyx_memviewslice *memviewslice,
                PyObject *original_obj)
{
    struct __pyx_memoryview_obj *memview, *new_memview;
    __Pyx_RefNannyDeclarations
    Py_buffer *buf;
    int i, spec = 0, retval = -1;
    __Pyx_BufFmt_Context ctx;
    int from_memoryview = __pyx_memoryview_check(original_obj);
    __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
    if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
                                                            original_obj)->typeinfo)) {
        memview = (struct __pyx_memoryview_obj *) original_obj;
        new_memview = NULL;
    } else {
        memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                            original_obj, buf_flags, 0, dtype);
        new_memview = memview;
        if (unlikely(!memview))
            goto fail;
    }
    buf = &memview->view;
    if (buf->ndim != ndim) {
        PyErr_Format(PyExc_ValueError,
                "Buffer has wrong number of dimensions (expected %d, got %d)",
                ndim, buf->ndim);
        goto fail;
    }
    if (new_memview) {
        __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 "u byte%s) "
                     "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
                     buf->itemsize,
                     (buf->itemsize > 1) ? "s" : "",
                     dtype->name,
                     dtype->size,
                     (dtype->size > 1) ? "s" : "");
        goto fail;
    }
    for (i = 0; i < ndim; i++) {
        spec = axes_specs[i];
        if (!__pyx_check_strides(buf, i, ndim, spec))
            goto fail;
        if (!__pyx_check_suboffsets(buf, i, ndim, spec))
            goto fail;
    }
    if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
        goto fail;
    if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
                                         new_memview != NULL) == -1)) {
        goto fail;
    }
    retval = 0;
    goto no_fail;
fail:
    Py_XDECREF(new_memview);
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}

/* ObjectToMemviewSlice */
              static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
                                                 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 2,
                                                 &__Pyx_TypeInfo_double, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

/* ObjectToMemviewSlice */
              static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
                                                 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
                                                 &__Pyx_TypeInfo_double, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

/* ObjectToMemviewSlice */
              static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
                                                 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
                                                 &__Pyx_TypeInfo_int, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

/* ObjectToMemviewSlice */
              static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_int(PyObject *obj) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
                                                 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 2,
                                                 &__Pyx_TypeInfo_int, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

/* CIntToPy */
              static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* MemviewDtypeToObject */
              static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
    return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
}
static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
    double value = __pyx_PyFloat_AsDouble(obj);
    if ((value == (double)-1) && PyErr_Occurred())
        return 0;
    *(double *) itemp = value;
    return 1;
}

static PyObject* __pyx_convert__to_py_struct____pyx_t_9pylsewave_5cynum_cvessel(struct __pyx_t_9pylsewave_5cynum_cvessel s) {
                PyObject* res;
                PyObject* member;
                res = PyDict_New(); if (unlikely(!res)) return NULL;
                member = __pyx_memoryview_fromslice(s.r0, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_r0, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.f_r0, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_f_r0, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.interpolate_R0p, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_interpolate_R0p, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.interpolate_R0m, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_interpolate_R0m, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.f_r0_ph, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_f_r0_ph, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.f_r0_mh, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_f_r0_mh, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.df_dr0, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_df_dr0, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.df_dx, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_df_dx, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.df_dr0_ph, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_df_dr0_ph, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.df_dx_ph, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_df_dx_ph, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.df_dr0_mh, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_df_dr0_mh, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.df_dx_mh, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_df_dx_mh, member) < 0)) goto bad;
                Py_DECREF(member);
                member = PyFloat_FromDouble(s.L); if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_L, member) < 0)) goto bad;
                Py_DECREF(member);
                member = PyFloat_FromDouble(s.dx); if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_dx, member) < 0)) goto bad;
                Py_DECREF(member);
                member = PyFloat_FromDouble(s.phi); if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_phi, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.RLC, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_RLC, member) < 0)) goto bad;
                Py_DECREF(member);
                return res;
                bad:
                Py_XDECREF(member);
                Py_DECREF(res);
                return NULL;
              }
              /* CIntToPy */
              static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
                                     little, !is_unsigned);
    }
}

/* MemviewDtypeToObject */
              static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
    return (PyObject *) __Pyx_PyInt_From_int(*(int *) itemp);
}
static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
    int value = __Pyx_PyInt_As_int(obj);
    if ((value == (int)-1) && PyErr_Occurred())
        return 0;
    *(int *) itemp = value;
    return 1;
}

/* CIntToPy */
              static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* Print */
              #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0) {
                switch (s[len-1]) {
                    case ' ': break;
                    case '\f': case '\r': case '\n': case '\t': case '\v':
                        PyFile_SoftSpace(f, 0);
                        break;
                    default:  break;
                }
            }
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

/* None */
              static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) {
  int err;
  #ifdef WITH_THREAD
  PyGILState_STATE _save = PyGILState_Ensure();
  #endif
  err = !!PyErr_Occurred();
  #ifdef WITH_THREAD
  PyGILState_Release(_save);
  #endif
  return err;
}

/* CIntToPy */
              static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_9pylsewave_5cynum_SOLVER(enum __pyx_t_9pylsewave_5cynum_SOLVER value) {
    const enum __pyx_t_9pylsewave_5cynum_SOLVER neg_one = (enum __pyx_t_9pylsewave_5cynum_SOLVER) -1, const_zero = (enum __pyx_t_9pylsewave_5cynum_SOLVER) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER),
                                     little, !is_unsigned);
    }
}

static PyObject* __pyx_convert__to_py_struct____pyx_t_9pylsewave_5cynum_cParabolicSolObj(struct __pyx_t_9pylsewave_5cynum_cParabolicSolObj s) {
                PyObject* res;
                PyObject* member;
                res = PyDict_New(); if (unlikely(!res)) return NULL;
                member = __pyx_memoryview_fromslice(s.x_hyper, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_x_hyper, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.a, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_a, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.b, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_b, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_c, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.d, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_d, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.a_ph, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_a_ph, member) < 0)) goto bad;
                Py_DECREF(member);
                member = __pyx_memoryview_fromslice(s.a_mh, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!member)) goto bad;
                if (unlikely(PyDict_SetItem(res, __pyx_n_s_a_mh, member) < 0)) goto bad;
                Py_DECREF(member);
                return res;
                bad:
                Py_XDECREF(member);
                Py_DECREF(res);
                return NULL;
              }
              /* None */
              #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

/* None */
              #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

/* None */
              #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

/* None */
              #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

/* CIntToPy */
              static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
    const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum NPY_TYPES) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
                                     little, !is_unsigned);
    }
}

/* MemviewSliceCopyTemplate */
              static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                 const char *mode, int ndim,
                                 size_t sizeof_dtype, int contig_flag,
                                 int dtype_is_object)
{
    __Pyx_RefNannyDeclarations
    int i;
    __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
    struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
    Py_buffer *buf = &from_memview->view;
    PyObject *shape_tuple = NULL;
    PyObject *temp_int = NULL;
    struct __pyx_array_obj *array_obj = NULL;
    struct __pyx_memoryview_obj *memview_obj = NULL;
    __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
    for (i = 0; i < ndim; i++) {
        if (from_mvs->suboffsets[i] >= 0) {
            PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
                                           "indirect dimensions (axis %d)", i);
            goto fail;
        }
    }
    shape_tuple = PyTuple_New(ndim);
    if (unlikely(!shape_tuple)) {
        goto fail;
    }
    __Pyx_GOTREF(shape_tuple);
    for(i = 0; i < ndim; i++) {
        temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
        if(unlikely(!temp_int)) {
            goto fail;
        } else {
            PyTuple_SET_ITEM(shape_tuple, i, temp_int);
            temp_int = NULL;
        }
    }
    array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
    if (unlikely(!array_obj)) {
        goto fail;
    }
    __Pyx_GOTREF(array_obj);
    memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                    (PyObject *) array_obj, contig_flag,
                                    dtype_is_object,
                                    from_mvs->memview->typeinfo);
    if (unlikely(!memview_obj))
        goto fail;
    if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
        goto fail;
    if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
                                                dtype_is_object) < 0))
        goto fail;
    goto no_fail;
fail:
    __Pyx_XDECREF(new_mvs.memview);
    new_mvs.memview = NULL;
    new_mvs.data = NULL;
no_fail:
    __Pyx_XDECREF(shape_tuple);
    __Pyx_XDECREF(temp_int);
    __Pyx_XDECREF(array_obj);
    __Pyx_RefNannyFinishContext();
    return new_mvs;
}

/* CIntFromPy */
              static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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_IntOrLong(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;
}

/* CIntFromPy */
              static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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 (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntFromPy */
              static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (Py_intptr_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Py_intptr_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (Py_intptr_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Py_intptr_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(Py_intptr_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
                            return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
                            return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
                            return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(Py_intptr_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x))
            } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            Py_intptr_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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 (Py_intptr_t) -1;
        }
    } else {
        Py_intptr_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (Py_intptr_t) -1;
        val = __Pyx_PyInt_As_Py_intptr_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Py_intptr_t");
    return (Py_intptr_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Py_intptr_t");
    return (Py_intptr_t) -1;
}

/* CIntFromPy */
              static CYTHON_INLINE enum __pyx_t_9pylsewave_5cynum_SOLVER __Pyx_PyInt_As_enum____pyx_t_9pylsewave_5cynum_SOLVER(PyObject *x) {
    const enum __pyx_t_9pylsewave_5cynum_SOLVER neg_one = (enum __pyx_t_9pylsewave_5cynum_SOLVER) -1, const_zero = (enum __pyx_t_9pylsewave_5cynum_SOLVER) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum __pyx_t_9pylsewave_5cynum_SOLVER) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum __pyx_t_9pylsewave_5cynum_SOLVER) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) >= 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_9pylsewave_5cynum_SOLVER) (((((enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) >= 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_9pylsewave_5cynum_SOLVER) (((((((enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) >= 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_9pylsewave_5cynum_SOLVER) (((((((((enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (enum __pyx_t_9pylsewave_5cynum_SOLVER) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_9pylsewave_5cynum_SOLVER, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_9pylsewave_5cynum_SOLVER, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum __pyx_t_9pylsewave_5cynum_SOLVER) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) - 1 > 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_9pylsewave_5cynum_SOLVER) (((enum __pyx_t_9pylsewave_5cynum_SOLVER)-1)*(((((enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) - 1 > 2 * PyLong_SHIFT) {
                            return (enum __pyx_t_9pylsewave_5cynum_SOLVER) ((((((enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) - 1 > 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_9pylsewave_5cynum_SOLVER) (((enum __pyx_t_9pylsewave_5cynum_SOLVER)-1)*(((((((enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) - 1 > 3 * PyLong_SHIFT) {
                            return (enum __pyx_t_9pylsewave_5cynum_SOLVER) ((((((((enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) - 1 > 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_9pylsewave_5cynum_SOLVER) (((enum __pyx_t_9pylsewave_5cynum_SOLVER)-1)*(((((((((enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_9pylsewave_5cynum_SOLVER, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) - 1 > 4 * PyLong_SHIFT) {
                            return (enum __pyx_t_9pylsewave_5cynum_SOLVER) ((((((((((enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_9pylsewave_5cynum_SOLVER)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_9pylsewave_5cynum_SOLVER, long, PyLong_AsLong(x))
            } else if (sizeof(enum __pyx_t_9pylsewave_5cynum_SOLVER) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_9pylsewave_5cynum_SOLVER, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum __pyx_t_9pylsewave_5cynum_SOLVER val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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 (enum __pyx_t_9pylsewave_5cynum_SOLVER) -1;
        }
    } else {
        enum __pyx_t_9pylsewave_5cynum_SOLVER val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum __pyx_t_9pylsewave_5cynum_SOLVER) -1;
        val = __Pyx_PyInt_As_enum____pyx_t_9pylsewave_5cynum_SOLVER(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum __pyx_t_9pylsewave_5cynum_SOLVER");
    return (enum __pyx_t_9pylsewave_5cynum_SOLVER) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum __pyx_t_9pylsewave_5cynum_SOLVER");
    return (enum __pyx_t_9pylsewave_5cynum_SOLVER) -1;
}

/* PrintOne */
              #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

/* CIntFromPy */
              static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
    const char neg_one = (char) -1, const_zero = (char) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(char) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (char) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (char) 0;
                case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
                case 2:
                    if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
                            return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
                            return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
                            return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (char) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(char) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (char) 0;
                case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                            return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                            return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
                            return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(char) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
            } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            char val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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 (char) -1;
        }
    } else {
        char val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (char) -1;
        val = __Pyx_PyInt_As_char(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to char");
    return (char) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to char");
    return (char) -1;
}

/* CIntFromPy */
              static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(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_IntOrLong(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;
}

/* CheckBinaryVersion */
              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;
}

/* ModuleImport */
              #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

/* TypeImport */
              #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. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        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. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

/* InitStrings */
              static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
